Fixed portability problems with va_copy. In three places, calls to fstat
had to be replaced by calls to stat, because fileno is no longer available when forcing the compiler into pure c89 (or c99) mode. git-svn-id: svn://svn.cc65.org/cc65/trunk@3683 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# gcc Makefile for the binutils common stuff
|
||||
#
|
||||
|
||||
CFLAGS = -g -O2 -Wall -W
|
||||
CFLAGS = -g -O2 -Wall -W -std=c89
|
||||
CC = gcc
|
||||
LDFLAGS =
|
||||
LIB = common.a
|
||||
@@ -72,6 +72,6 @@ zap: clean
|
||||
.PHONY: depend dep
|
||||
depend dep: $(OBJS:.o=.c)
|
||||
@echo "Creating dependency information"
|
||||
$(CC) -MM $^ > .depend
|
||||
$(CC) $(CFLAGS) -MM $^ > .depend
|
||||
|
||||
|
||||
|
||||
@@ -38,18 +38,27 @@
|
||||
|
||||
|
||||
|
||||
/* No action if we're using a C99 compiler */
|
||||
#if (__STDC_VERSION__ < 199901)
|
||||
|
||||
|
||||
|
||||
/* The watcom compiler doesn't have va_copy and a problematic va_list definition */
|
||||
#if defined(__WATCOMC__)
|
||||
#define va_copy(dest,src) memcpy((dest), (src), sizeof (va_list))
|
||||
#endif
|
||||
|
||||
/* GNU C before version 3 has its own name */
|
||||
#if defined(__GNUC__) && (__GNUC__ == 2)
|
||||
/* GNU C has a builtin function */
|
||||
#if defined(__GNUC__)
|
||||
#define va_copy(dest,src) __va_copy(dest, src)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* #if (__STDC_VERSION__ < 199901) */
|
||||
|
||||
|
||||
|
||||
/* End of va_copy.h */
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user