Kaydet (Commit) d72a0b5c authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Check for __GNUC__ instead of GCC in sources

We still have checks for $(COM) being GCC or MSC in makefiles, of
course. But there is no reason to pass -D$(COM) to compilations.
Checking the built-in compiler-specific macros __GNUC__, _MSC_VER
(etc) is the right thing to do.

Change-Id: Ia961a29ba74e2c4977e5300a92318f38104c6592
üst c318f3b0
......@@ -240,7 +240,9 @@ static OUString val2str( void const * pVal, typelib_TypeDescriptionReference * p
case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") );
#if defined(GCC) && defined(SPARC)
#if defined(__GNUC__) && defined(SPARC)
// I guess this really should check if there are strict alignment
// requirements, not just "GCC on SPARC".
{
sal_Int64 aVal;
*(sal_Int32 *)&aVal = *(sal_Int32 *)pVal;
......
......@@ -272,7 +272,9 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef
case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER:
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") );
#if defined(GCC) && defined(SPARC)
#if defined(__GNUC__) && defined(SPARC)
// I guess this really should check if there are strict alignment
// requirements, not just "GCC on SPARC".
{
sal_Int64 aVal;
*(sal_Int32 *)&aVal = *(sal_Int32 *)pVal;
......
......@@ -31,7 +31,7 @@ static RscCompiler * pRscCompiler = NULL;
/* */
/* Description : Gibt die Temporaeren Dateien frei. */
/****************************************************************/
#if defined( UNX ) || defined ( GCC ) || defined(__MINGW32__)
#if defined( UNX ) || defined ( __GNUC__ ) || defined(__MINGW32__)
void ExitProgram( void ){
#else
void cdecl ExitProgram( void ){
......
......@@ -80,7 +80,7 @@ SAL_DLLPUBLIC void SAL_CALL sal_detail_logFormat(
enum sal_detail_LogLevel level, char const * area, char const * where,
char const * format, ...)
/* TODO: enabling this will produce a huge amount of -Werror=format errors: */
#if defined GCC && 0
#if defined __GNUC__ && 0
__attribute__((format(printf, 4, 5)))
#endif
;
......
......@@ -27,7 +27,7 @@
#error please use asm/interlck_sparc.s
#elif defined ( SOLARIS) && defined ( X86 )
#error please use asm/interlck_x86.s
#elif defined ( GCC ) && ( defined ( X86 ) || defined ( X86_64 ) )
#elif defined ( __GNUC__ ) && ( defined ( X86 ) || defined ( X86_64 ) )
/* That's possible on x86-64 too since oslInterlockedCount is a sal_Int32 */
extern int osl_isSingleCPU;
......
......@@ -259,7 +259,7 @@ void osl_InitSparcV9(void)
#endif /* SOLARIS */
#if defined(NETBSD) && defined(GCC) && !defined(__sparcv9) && !defined(__sparc_v9__)
#if defined(NETBSD) && defined(__GNUC__) && !defined(__sparcv9) && !defined(__sparc_v9__)
#include <sys/param.h>
#include <sys/sysctl.h>
......
......@@ -57,7 +57,6 @@ gb_CPPU_ENV := gcc3
gb_AFLAGS := $(AFLAGS)
gb_COMPILERDEFS := \
-D$(COM) \
-DCPPU_ENV=$(gb_CPPU_ENV) \
gb_CFLAGS_COMMON := \
......
......@@ -46,7 +46,7 @@ USE_CFLAGS_X64=-c -nologo -Gs $(NOLOGO) -Zm500 -Zc:forScope,wchar_t- -GR
# Stack buffer overrun detection.
CFLAGS+=-GS
USE_CDEFS_X64+= -D$(OS) -D$(GUI) -D$(COM) -DX86_64 -DWIN32 -D_AMD64_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS
USE_CDEFS_X64+= -D$(OS) -D$(GUI) -DX86_64 -DWIN32 -D_AMD64_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS
.IF "$(debug)"!=""
USE_CFLAGS_X64+=-Zi -Fd$(MISC_X64)/$(@:b).pdb
USE_CDEFS_X64+=-DDEBUG
......
......@@ -799,7 +799,7 @@ CDEFS=-D$(OS)
.IF "$(GUI)" != "$(OS)"
CDEFS+=-D$(GUI)
.ENDIF
CDEFS+=-D$(COM) -D$(CPUNAME)
CDEFS+=-D$(CPUNAME)
.IF "$(USE_DEBUG_RUNTIME)" != ""
CDEFS+=-D_DEBUG_RUNTIME
......
......@@ -29,7 +29,7 @@ class SwBodyFrm: public SwLayoutFrm
protected:
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
#if defined ( GCC) && defined ( C272 )
#if defined ( __GNUC__ ) && defined ( C272 )
~SwBodyFrm();
#endif
......
......@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined (UNX) || defined (GCC)
#if defined (UNX) || defined (__GNUC__)
#include <unistd.h>
#else
#include <direct.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment