Workaround for SunOS of conflict between system and local int8_t definitions.

System headers implies that char is signed by ABI and define the type as
`char' while GoldEd has to be compiled with -funsigned-char and defines it
as `signed char'. Thus we have conflict definition. At the same time goldlib
cannot be compiled with -fsigned-char.
This commit is contained in:
Stanislav Mekhanoshin 2006-02-01 10:06:07 +00:00
parent a49d62da90
commit 5050e3eb8e
3 changed files with 8 additions and 7 deletions

View File

@ -42,7 +42,6 @@ WINDRES=windres
EXEEXT=.exe
OBJEXT=.o
LIBEXT=.a
CFLAGS+=-funsigned-char
else
ifeq ($(PLATFORM),emx)
CAT=cat
@ -64,7 +63,6 @@ LIBEXT=.a
#OBJEXT=.obj
#LIBEXT=.lib
CXX=$(CC)
CFLAGS+=-funsigned-char
else
ifeq ($(PLATFORM),djg)
CAT=command.com /c type
@ -78,7 +76,6 @@ SHELL=sh
EXEEXT=.exe
OBJEXT=.o
LIBEXT=.a
CFLAGS+=-funsigned-char
else
ifeq ($(PLATFORM),be)
CAT=cat
@ -91,7 +88,6 @@ RANLIB=ranlib
EXEEXT=
OBJEXT=.o
LIBEXT=.a
CFLAGS+=-funsigned-char
LNKFLAGS+=-lbe -ltextencoding
else
ifeq ($(PLATFORM),sun) # SUN Solaris
@ -105,7 +101,7 @@ RANLIB=ranlib
EXEEXT=
OBJEXT=.o
LIBEXT=.a
CFLAGS+=-fsigned-char -D__SUNOS__ -D__UNIX__ -DUNIX
CFLAGS+=-D__SUNOS__ -D__UNIX__ -DUNIX
else # Linux, *BSD or another unix-like OS
CAT=cat
SED=sed
@ -118,13 +114,12 @@ PLATFORM=lnx
EXEEXT=
OBJEXT=.o
LIBEXT=.a
CFLAGS+=-funsigned-char
endif
endif
endif
endif
endif
CFLAGS+=-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 # -fomit-frame-pointer
LNKFLAGS+=-g
CPPFLAGS+=$(CFLAGS) -fno-rtti # -fno-exceptions

View File

@ -144,7 +144,9 @@ typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#if !defined(__APPLE__)
#if !defined(__SUNOS__)
typedef signed char int8_t;
#endif
typedef signed short int16_t;
typedef signed int int32_t;
#endif

View File

@ -161,7 +161,9 @@ public:
#endif
gfile& operator>> (char& i) { return operator>>((uint8_t&)i); }
#if !defined(__SUNOS__)
gfile& operator>> (int8_t& i) { return operator>>((uint8_t&)i); }
#endif
gfile& operator>> (int16_t& i) { return operator>>((uint16_t&)i); }
gfile& operator>> (int32_t& i) { return operator>>((uint32_t&)i); }
#if !defined(__CYGWIN__)
@ -179,7 +181,9 @@ public:
#endif
gfile& operator<< (char o) { return operator<<((uint8_t )o); }
#if !defined(__SUNOS__)
gfile& operator<< (int8_t o) { return operator<<((uint8_t )o); }
#endif
gfile& operator<< (int16_t o) { return operator<<((uint16_t)o); }
gfile& operator<< (int32_t o) { return operator<<((uint32_t)o); }
#if !defined(__CYGWIN__)