[m-rev.] diff: fix problem with defining __GNU_LIBRARY__

Peter Ross petdr at cs.mu.OZ.AU
Tue Jun 5 23:27:11 AEST 2001


Hi,


===================================================================


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.

Index: runtime//GETOPT/getopt1.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/GETOPT/getopt1.c,v
retrieving revision 1.1
diff -u -r1.1 getopt1.c
--- runtime//GETOPT/getopt1.c	1998/08/10 07:18:25	1.1
+++ runtime//GETOPT/getopt1.c	2001/06/05 13:21:10
@@ -21,6 +21,8 @@
 #include <config.h>
 #endif
 
+#include <stdio.h>
+
 #include "getopt.h"
 
 #if !defined (__STDC__) || !__STDC__
@@ -30,8 +32,6 @@
 #define const
 #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
Index: util//Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/util/Mmakefile,v
retrieving revision 1.12
diff -u -r1.12 Mmakefile
--- util//Mmakefile	2001/05/22 04:17:33	1.12
+++ util//Mmakefile	2001/06/05 13:13:19
@@ -24,8 +24,6 @@
 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 @@
 all:	$(PROGS)
 
 .c:
-	$(MGNUC) $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(GETOPT_FLAGS) -o $@ $< $(GETOPT_SRC)
+	$(MGNUC) $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ $< $(GETOPT_SRC)
 
 tags:
 	ctags $(SRC)

----
Peter Ross
PhD Student University of Melbourne
http://www.cs.mu.oz.au/~petdr/
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list