mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-10 11:23:15 +00:00
Define __GNU_LIBRARY__ by including stdio.h before getopt.h.
Estimated hours taken: 0.2
Branches: main
runtime/GETOPT/getopt1.c:
Define __GNU_LIBRARY__ by including stdio.h before getopt.h.
util/Mmakefile:
Remove harding coding of __GNU_LIBRARY__ define as we should only
define this when we are using the GNU version of libc.
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
#if !defined (__STDC__) || !__STDC__
|
||||
@@ -31,8 +33,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
Library, but also included in many other GNU distributions. Compiling
|
||||
|
||||
@@ -24,8 +24,6 @@ PROGS=mkinit mdemangle info_to_mdb
|
||||
PROGFILENAMES=$(PROGS:%=%$(EXT_FOR_EXE))
|
||||
SRC=$(PROGS:%=%.c)
|
||||
|
||||
# GETOPT_FLAGS suppresses warnings about the prototype of getopt
|
||||
GETOPT_FLAGS=-D__GNU_LIBRARY__
|
||||
GETOPT_SRC=$(RUNTIME_DIR)/GETOPT/getopt.c $(RUNTIME_DIR)/GETOPT/getopt1.c
|
||||
|
||||
# mkinit.c needs `struct stat'
|
||||
@@ -36,7 +34,7 @@ MGNUCFLAGS-mkinit = --no-ansi
|
||||
all: $(PROGS)
|
||||
|
||||
.c:
|
||||
$(MGNUC) $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(GETOPT_FLAGS) -o $@ $< $(GETOPT_SRC)
|
||||
$(MGNUC) $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ $< $(GETOPT_SRC)
|
||||
|
||||
tags:
|
||||
ctags $(SRC)
|
||||
|
||||
Reference in New Issue
Block a user