From 016fc30839f0fb67bb37d4a7353a7e38749deab5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 3 Mar 2010 16:02:45 -0800 Subject: [PATCH] Remove support for GCC older than 3.3.0 Signed-off-by: Ian Romanick --- include/GL/gl.h | 3 +-- include/GL/glut.h | 2 +- src/egl/main/eglcompiler.h | 5 ++--- src/gallium/include/pipe/p_compiler.h | 7 +++---- src/glx/XF86dri.c | 2 +- src/glx/glxclient.h | 2 +- src/glx/indirect_vertex_program.c | 2 +- src/glx/pixelstore.c | 2 +- src/mesa/glapi/glapi.h | 2 +- src/mesa/main/compiler.h | 10 ++++------ src/mesa/main/imports.h | 4 +--- src/mesa/x86/assyntax.h | 2 +- 12 files changed, 18 insertions(+), 25 deletions(-) diff --git a/include/GL/gl.h b/include/GL/gl.h index 3fce3dfc0a1..8e5f1383ffa 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -67,8 +67,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) \ - || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +#elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define GLAPI __attribute__((visibility("default"))) # define GLAPIENTRY #endif /* WIN32 && !CYGWIN */ diff --git a/include/GL/glut.h b/include/GL/glut.h index d9fc938dc7a..a2826352051 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -103,7 +103,7 @@ extern "C" { # define GLUTAPI extern #endif -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#elif defined(__GNUC__) # define GLUTAPIENTRY # define GLUTAPIENTRYV diff --git a/src/egl/main/eglcompiler.h b/src/egl/main/eglcompiler.h index d844fbb0efb..401a9cf56ad 100644 --- a/src/egl/main/eglcompiler.h +++ b/src/egl/main/eglcompiler.h @@ -64,8 +64,7 @@ /** * Function visibility */ -#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ - || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PUBLIC __attribute__((visibility("default"))) #else # define PUBLIC @@ -79,7 +78,7 @@ #ifndef __FUNCTION__ # if defined(__VMS) # define __FUNCTION__ "VMS$NL:" -# elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \ +# elif (!defined __GNUC__) && (!defined __xlC__) && \ (!defined(_MSC_VER) || _MSC_VER < 1300) # if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ (defined(__SUNPRO_C) && defined(__C99FEATURES__)) diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index c7d35074948..b93b38310ac 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -106,8 +106,7 @@ typedef unsigned char boolean; /* Function visibility */ #ifndef PUBLIC -# if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ - || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PUBLIC __attribute__((visibility("default"))) # else # define PUBLIC @@ -119,7 +118,7 @@ typedef unsigned char boolean; * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. */ #ifndef __FUNCTION__ -# if (!defined(__GNUC__) || (__GNUC__ < 2)) +# if !defined(__GNUC__) # if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ (defined(__SUNPRO_C) && defined(__C99FEATURES__)) # define __FUNCTION__ __func__ @@ -145,7 +144,7 @@ typedef unsigned char boolean; -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#if defined(__GNUC__) #define PIPE_DEPRECATED __attribute__((__deprecated__)) #else #define PIPE_DEPRECATED diff --git a/src/glx/XF86dri.c b/src/glx/XF86dri.c index 248d96ac5de..fdbdd43000e 100644 --- a/src/glx/XF86dri.c +++ b/src/glx/XF86dri.c @@ -45,7 +45,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86dristr.h" -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#if defined(__GNUC__) # define PUBLIC __attribute__((visibility("default"))) # define USED __attribute__((used)) #else diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 04ce781c435..8e5dc785dd9 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -69,7 +69,7 @@ * We also need to define a USED attribute, so the optimizer doesn't * inline a static function that we later use in an alias. - ajax */ -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#if defined(__GNUC__) # define PUBLIC __attribute__((visibility("default"))) # define USED __attribute__((used)) #else diff --git a/src/glx/indirect_vertex_program.c b/src/glx/indirect_vertex_program.c index 3313ac008a5..d822a7ee56e 100644 --- a/src/glx/indirect_vertex_program.c +++ b/src/glx/indirect_vertex_program.c @@ -30,7 +30,7 @@ #include "indirect_vertex_array.h" #include -#if !defined __GNUC__ || __GNUC__ < 3 +#if !defined(__GNUC__) # define __builtin_expect(x, y) x #endif diff --git a/src/glx/pixelstore.c b/src/glx/pixelstore.c index 8b51b5d8b7f..dc193b9f747 100644 --- a/src/glx/pixelstore.c +++ b/src/glx/pixelstore.c @@ -31,7 +31,7 @@ #include "glxclient.h" #include "indirect.h" -#if !defined __GNUC__ || __GNUC__ < 3 +#if !defined(__GNUC__) # define __builtin_expect(x, y) x #endif diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index 2eae6d5c438..1ca2e4beff1 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -62,7 +62,7 @@ typedef void (*_glapi_proc)(void); /* generic function pointer */ #endif -#if defined(__GNUC__) && (__GNUC__ >= 3) +#if defined(__GNUC__) # define likely(x) __builtin_expect(!!(x), 1) # define unlikely(x) __builtin_expect(!!(x), 0) #else diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 9cef99f67a5..05e69e56a6b 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -173,8 +173,7 @@ extern "C" { * We also need to define a USED attribute, so the optimizer doesn't * inline a static function that we later use in an alias. - ajax */ -#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ - || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) # define PUBLIC __attribute__((visibility("default"))) # define USED __attribute__((used)) #else @@ -197,7 +196,7 @@ extern "C" { /** * __builtin_expect macros */ -#if (!defined(__GNUC__) || __GNUC__ < 3) && (!defined(__IBMC__) || __IBMC__ < 900) +#if !defined(__GNUC__) # define __builtin_expect(x, y) x #endif @@ -210,7 +209,7 @@ extern "C" { #ifndef __FUNCTION__ # if defined(__VMS) # define __FUNCTION__ "VMS$NL:" -# elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \ +# elif !defined(__GNUC__) && !defined(__xlC__) && \ (!defined(_MSC_VER) || _MSC_VER < 1300) # if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ (defined(__SUNPRO_C) && defined(__C99FEATURES__)) @@ -322,8 +321,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) * LONGSTRING macro * gcc -pedantic warns about long string literals, LONGSTRING silences that. */ -#if !defined(__GNUC__) || (__GNUC__ < 2) || \ - ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)) +#if !defined(__GNUC__) # define LONGSTRING #else # define LONGSTRING __extension__ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index ac3a7b5d61a..fb4a00eca7b 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -240,9 +240,7 @@ static INLINE int GET_FLOAT_BITS( float x ) /*** *** IROUND: return (as an integer) float rounded to nearest integer ***/ -#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) && \ - (!(defined(__BEOS__) || defined(__HAIKU__)) || \ - (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))) +#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) static INLINE int iround(float f) { int r; diff --git a/src/mesa/x86/assyntax.h b/src/mesa/x86/assyntax.h index de1f6a48ded..4a41812f6b6 100644 --- a/src/mesa/x86/assyntax.h +++ b/src/mesa/x86/assyntax.h @@ -1737,7 +1737,7 @@ SECTION _DATA public align=16 class=DATA use32 flat */ #if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) # define HIDDEN(x) .hidden x -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) +#elif defined(__GNUC__) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) # pragma GCC visibility push(default) # define HIDDEN(x) .hidden x #else -- 2.30.2