From 8963cc01f5267f3afc4e4a4ff5a65a67520f447b Mon Sep 17 00:00:00 2001 From: Alexander Bergmann Date: Thu, 9 Feb 2012 13:15:27 +0100 Subject: EasyHack: Removed gcc conditionals --- Mesa/inc/gl.h | 2 +- cppcanvas/source/mtfrenderer/textaction.cxx | 5 +---- cppcanvas/source/uno/uno_mtfrenderer.cxx | 6 ------ hwpfilter/source/grammar.cxx | 6 ++---- np_sdk/inc/npapi.h | 2 +- np_sdk/inc/npfunctions.h | 3 +-- np_sdk/inc/nptypes.h | 10 ---------- sal/inc/sal/types.h | 4 ++-- sal/osl/unx/file_stat.cxx | 8 -------- sal/osl/unx/process_impl.cxx | 2 +- sal/osl/unx/system.h | 3 --- .../source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm | 6 ------ .../source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx | 6 ------ .../source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx | 8 +------- slideshow/source/engine/slideshowimpl.cxx | 8 +------- svl/inc/svl/svarray.hxx | 4 ++-- sw/inc/fmtfollowtextflow.hxx | 4 ---- 17 files changed, 13 insertions(+), 74 deletions(-) diff --git a/Mesa/inc/gl.h b/Mesa/inc/gl.h index b427637e6ece..4945c031e0e7 100644 --- a/Mesa/inc/gl.h +++ b/Mesa/inc/gl.h @@ -62,7 +62,7 @@ #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ # define GLAPI extern # define GLAPIENTRY __stdcall -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#elif defined(__GNUC__) # define GLAPI __attribute__((visibility("default"))) # define GLAPIENTRY #endif /* WIN32 && !CYGWIN */ diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index 71c29ca07c67..d6da081d06e1 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -2284,11 +2284,8 @@ namespace cppcanvas rState ) ); } } -#if defined __GNUC__ -#if __GNUC__ == 4 - // Unreachable; to avoid bogus warning: +#if defined(__GNUC__) return ActionSharedPtr(); -#endif #endif } } diff --git a/cppcanvas/source/uno/uno_mtfrenderer.cxx b/cppcanvas/source/uno/uno_mtfrenderer.cxx index 596b5e7c82b4..dacaeab7d1db 100644 --- a/cppcanvas/source/uno/uno_mtfrenderer.cxx +++ b/cppcanvas/source/uno/uno_mtfrenderer.cxx @@ -66,14 +66,8 @@ MtfRenderer::MtfRenderer (uno::Sequence const& aArgs, uno::Reference > serviceImpl; - const sdecl::ServiceDecl MtfRendererDecl( - serviceImpl, -#else const sdecl::ServiceDecl MtfRendererDecl( sdecl::class_ >(), -#endif "com.sun.star.comp.rendering.MtfRenderer", "com.sun.star.rendering.MtfRenderer" ); diff --git a/hwpfilter/source/grammar.cxx b/hwpfilter/source/grammar.cxx index 2afc1d897490..2285aabc62b3 100644 --- a/hwpfilter/source/grammar.cxx +++ b/hwpfilter/source/grammar.cxx @@ -539,11 +539,9 @@ int yydebug; /* nonzero means print parse trace */ definitions require. With GCC, __builtin_memcpy takes an arg of type size_t, but it can handle unsigned int. */ -#if defined __GNUC__ -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#if defined(__GNUC__) #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#endif -#else /* not GNU C or C++ */ +#else #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities diff --git a/np_sdk/inc/npapi.h b/np_sdk/inc/npapi.h index d67dcd3c35d4..7db99814b73a 100644 --- a/np_sdk/inc/npapi.h +++ b/np_sdk/inc/npapi.h @@ -310,7 +310,7 @@ typedef enum { * gcc 3.x generated vtables on UNIX and OSX are incompatible with * previous compilers. */ -#if (defined(XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3)) +#if defined(XP_UNIX) && defined(__GNUC__) #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK #else #define _NP_ABI_MIXIN_FOR_GCC3 0 diff --git a/np_sdk/inc/npfunctions.h b/np_sdk/inc/npfunctions.h index abc14733a2c2..90faa3ce171d 100644 --- a/np_sdk/inc/npfunctions.h +++ b/np_sdk/inc/npfunctions.h @@ -247,8 +247,7 @@ typedef OSErr (*BP_GetSupportedMIMETypesProcPtr)(BPSupportedMIMETypes*, UInt32); #endif #if defined(XP_UNIX) -/* GCC 3.3 and later support the visibility attribute. */ -#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) +#if defined(__GNUC__) #define NP_VISIBILITY_DEFAULT __attribute__((visibility("default"))) #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) #define NP_VISIBILITY_DEFAULT __global diff --git a/np_sdk/inc/nptypes.h b/np_sdk/inc/nptypes.h index 300128885cc3..d5faf5f4921c 100644 --- a/np_sdk/inc/nptypes.h +++ b/np_sdk/inc/nptypes.h @@ -104,17 +104,7 @@ #include #ifndef __cplusplus - #if !defined(__GNUC__) || (__GNUC__ > 2 || __GNUC_MINOR__ > 95) #include - #else - /* - * GCC 2.91 can't deal with a typedef for bool, but a #define - * works. - */ - #define bool int - #define true 1 - #define false 0 - #endif #endif #endif diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h index f04c14cd0ff1..1bed00c105b4 100644 --- a/sal/inc/sal/types.h +++ b/sal/inc/sal/types.h @@ -308,7 +308,7 @@ typedef void * sal_Handle; Compilers that support a construct of this nature will emit a compile time warning on unchecked return value. */ -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#if defined(__GNUC__) # define SAL_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else # define SAL_WARN_UNUSED_RESULT @@ -453,7 +453,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) { #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) # define SAL_DEPRECATED(message) __attribute__((deprecated(message))) -#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#elif (__GNUC__) # define SAL_DEPRECATED(message) __attribute__((deprecated)) #elif defined(_MSC_VER) # define SAL_DEPRECATED(message) __declspec(deprecated(message)) diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx index 781d9995dd2d..3469e22cbaf9 100644 --- a/sal/osl/unx/file_stat.cxx +++ b/sal/osl/unx/file_stat.cxx @@ -224,11 +224,7 @@ oslFileError SAL_CALL osl_getFileStatus(oslDirectoryItem Item, oslFileStatus* pS if (osl_File_E_None != osl_error) return osl_error; -#if defined(__GNUC__) && (__GNUC__ < 3) - struct ::stat file_stat; -#else struct stat file_stat; -#endif bool bStatNeeded = is_stat_call_necessary(uFieldMask, pImpl->getFileType()); if (bStatNeeded && (0 != osl::lstat(file_path, file_stat))) @@ -460,11 +456,7 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, oslDirectoryItem b) pB->m_ustrFilePath->buffer, pB->m_ustrFilePath->length ) == 0) return sal_True; -#if defined(__GNUC__) && (__GNUC__ < 3) - struct ::stat a_stat, b_stat; -#else struct stat a_stat, b_stat; -#endif if (osl::lstat(rtl::OUString(pA->m_ustrFilePath), a_stat) != 0 || osl::lstat(rtl::OUString(pB->m_ustrFilePath), b_stat) != 0) diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index 83c5c8872dbe..1582b581bf37 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -89,7 +89,7 @@ oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl ( char buffer[PATH_MAX]; size_t buflen = sizeof(buffer); -#if __GNUC__ >= 4 && defined(MACOSX) +#if defined(__GNUC__) && defined(MACOSX) if (_NSGetExecutablePath (buffer, (uint32_t*)&buflen) == 0) #else if (_NSGetExecutablePath (buffer, &buflen) == 0) diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h index 8df86203ca1f..576be1a09ee2 100644 --- a/sal/osl/unx/system.h +++ b/sal/osl/unx/system.h @@ -344,9 +344,6 @@ int macxp_resolveAlias(char *path, int buflen); # define PTHREAD_VALUE(t) (t) #endif #ifndef PTHREAD_NONE -# if (__GNUC__ < 4) && !defined(MACOSX) -extern pthread_t _pthread_none_; -# endif # define PTHREAD_NONE _pthread_none_ # ifndef PTHREAD_NONE_INIT # define PTHREAD_NONE_INIT ((pthread_t)-1) diff --git a/slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm b/slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm index c0f881a20a10..f3bfab40f664 100644 --- a/slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm +++ b/slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm @@ -1118,14 +1118,8 @@ public: } namespace sdecl = comphelper::service_decl; -#if defined (__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ <= 3) - sdecl::class_ serviceImpl; - const sdecl::ServiceDecl OGLTransitionFactoryDecl( - serviceImpl, -#else const sdecl::ServiceDecl OGLTransitionFactoryDecl( sdecl::class_(), -#endif "com.sun.star.comp.presentation.OGLTransitionFactory", "com.sun.star.presentation.TransitionFactory" ); diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx index c8cad45908ee..1f301e60fd99 100644 --- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx +++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx @@ -1464,14 +1464,8 @@ public: } namespace sdecl = comphelper::service_decl; -#if defined (__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ <= 3) - sdecl::class_ serviceImpl; - const sdecl::ServiceDecl OGLTransitionFactoryDecl( - serviceImpl, -#else const sdecl::ServiceDecl OGLTransitionFactoryDecl( sdecl::class_(), -#endif "com.sun.star.comp.presentation.OGLTransitionFactory", "com.sun.star.presentation.TransitionFactory" ); diff --git a/slideshow/source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx index 80e2e73a4ccc..7aa72062d662 100644 --- a/slideshow/source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx +++ b/slideshow/source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx @@ -1436,14 +1436,8 @@ public: } namespace sdecl = comphelper::service_decl; -#if defined (__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ <= 3) - sdecl::class_ serviceImpl; - const sdecl::ServiceDecl OGLTransitionFactoryDecl( - serviceImpl, -#else - const sdecl::ServiceDecl OGLTransitionFactoryDecl( +const sdecl::ServiceDecl OGLTransitionFactoryDecl( sdecl::class_(), -#endif "com.sun.star.comp.presentation.OGLTransitionFactory", "com.sun.star.presentation.TransitionFactory" ); diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index ffdf438ff33d..864c412cbf9b 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -2450,14 +2450,8 @@ void FrameSynchronization::Deactivate (void) } // anon namespace namespace sdecl = comphelper::service_decl; -#if defined (__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ <= 3) - sdecl::class_ serviceImpl; - const sdecl::ServiceDecl slideShowDecl( - serviceImpl, -#else - const sdecl::ServiceDecl slideShowDecl( +const sdecl::ServiceDecl slideShowDecl( sdecl::class_(), -#endif "com.sun.star.comp.presentation.SlideShow", "com.sun.star.presentation.SlideShow" ); diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index f1b9bb4a5a98..69074977fc6e 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.hxx @@ -738,13 +738,13 @@ SV_IMPL_VARARR(nm##_SAR, AE)\ _SV_IMPL_SORTAR_ALG( nm,AE )\ _SV_SEEK_OBJECT( nm,AE ) -#if defined (C40) || defined (C41) || defined (C42) || defined(C50) +#if defined(C40) || defined(C41) || defined(C42) || defined(C50) #define C40_INSERT( c, p, n) Insert( (c const *) p, n ) #define C40_PTR_INSERT( c, p) Insert( (c const *) p ) #define C40_REPLACE( c, p, n) Replace( (c const *) p, n ) #define C40_GETPOS( c, r) GetPos( (c const *)r ) #else -#if defined ICC || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400) +#if defined(ICC) || defined(GCC) || (defined(WNT) && _MSC_VER >= 1400) #define C40_INSERT( c, p, n ) Insert( (c const *&) p, n ) #define C40_PTR_INSERT( c, p ) Insert( (c const *&) p ) #define C40_REPLACE( c, p, n ) Replace( (c const *&) p, n ) diff --git a/sw/inc/fmtfollowtextflow.hxx b/sw/inc/fmtfollowtextflow.hxx index 7f079d3ca9b2..f687c25b79a9 100644 --- a/sw/inc/fmtfollowtextflow.hxx +++ b/sw/inc/fmtfollowtextflow.hxx @@ -53,15 +53,11 @@ public: const IntlWrapper* pIntl = 0 ) const; }; - -#if !(defined(MACOSX) && ( __GNUC__ < 3 )) -// GrP moved to gcc_outl.cxx; revisit with gcc3 inline const SwFmtFollowTextFlow &SwAttrSet::GetFollowTextFlow(sal_Bool bInP) const { return (const SwFmtFollowTextFlow&)Get( RES_FOLLOW_TEXT_FLOW, bInP ); } inline const SwFmtFollowTextFlow &SwFmt::GetFollowTextFlow(sal_Bool bInP) const { return aSet.GetFollowTextFlow( bInP ); } -#endif #endif -- cgit v1.2.3