Define HAVE_SNPRINTF, HAVE_VSNPRINTF, HAVE_STDARG_H at compile time (Fix DJGPP build)
This commit is contained in:
parent
2b8880986c
commit
c90f069a9a
@ -48,6 +48,7 @@ WINDRES=windres
|
||||
EXEEXT=.exe
|
||||
OBJEXT=.o
|
||||
LIBEXT=.a
|
||||
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
||||
else
|
||||
ifeq ($(PLATFORM),emx)
|
||||
CAT=cat
|
||||
@ -69,6 +70,7 @@ LIBEXT=.a
|
||||
#OBJEXT=.obj
|
||||
#LIBEXT=.lib
|
||||
CXX=$(CC)
|
||||
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
||||
else
|
||||
ifeq ($(PLATFORM),djg)
|
||||
CAT=command.com /c type
|
||||
@ -95,6 +97,7 @@ EXEEXT=
|
||||
OBJEXT=.o
|
||||
LIBEXT=.a
|
||||
LNKFLAGS+=-lbe -ltextencoding
|
||||
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
||||
else
|
||||
ifeq ($(PLATFORM),sun) # SUN Solaris
|
||||
CAT=cat
|
||||
@ -108,6 +111,7 @@ EXEEXT=
|
||||
OBJEXT=.o
|
||||
LIBEXT=.a
|
||||
CFLAGS+=-D__SUNOS__ -D__UNIX__ -DUNIX
|
||||
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
||||
ifeq ($(WIDE_NCURSES),1)
|
||||
LIBCURSES=-L/opt/csw/lib -lncursesw
|
||||
else
|
||||
@ -131,6 +135,7 @@ LIBCURSES=-lncursesw
|
||||
else
|
||||
LIBCURSES=-lncurses
|
||||
endif
|
||||
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
||||
else # Linux, *BSD or another unix-like OS
|
||||
CAT=cat
|
||||
SED=sed
|
||||
@ -155,7 +160,7 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
CFLAGS+=-funsigned-char -g $(INCS) -Wall -Wno-sign-compare -pedantic -O2 -DPRAGMA_PACK # -fomit-frame-pointer
|
||||
CFLAGS+=-funsigned-char -g $(INCS) -Wall -Wno-sign-compare -pedantic -O2 -DPRAGMA_PACK -DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H # -fomit-frame-pointer
|
||||
LNKFLAGS+=-g
|
||||
CPPFLAGS+=$(CFLAGS) -fno-rtti # -fno-exceptions
|
||||
|
||||
|
@ -59,8 +59,10 @@ char* strlwr(char* s);
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if !defined(HAVE_SNPRINTF)
|
||||
int snprintf( char *buffer, size_t sizeOfBuffer, const char *format, ... );
|
||||
#endif
|
||||
#if !defined(HAVE_VSNPRINTF)
|
||||
int vsnprintf( char *buffer, size_t sizeOfBuffer, const char *format, va_list argptr );
|
||||
#endif
|
||||
|
||||
|
@ -31,16 +31,6 @@
|
||||
// -------------------------------------------------------------------
|
||||
// snprintf() and vsnprintf()
|
||||
|
||||
// ---- FIXME: All HAVE_* macro should be defined in makefile or created by autoconf
|
||||
#ifdef __GNUC__
|
||||
# define HAVE_SNPRINTF
|
||||
# define HAVE_VSNPRINTF
|
||||
# define HAVE_STDARG_H
|
||||
#endif
|
||||
#if defined(__WATCOMC__)
|
||||
# define HAVE__SNPRINTF
|
||||
# define HAVE__VSNPRINTF
|
||||
#endif
|
||||
#if defined(_MSC_VER)
|
||||
/* It is need a workaround for implementation "speciality" in snprintf() and vsnprintf() from Microsoft. */
|
||||
int snprintf( char *buffer, size_t sizeOfBuffer, const char *format, ... )
|
||||
|
Reference in New Issue
Block a user