Default to use the visibility attribute, on gcc (is this okay?)
authorSam Lantinga <slouken@libsdl.org>
Wed, 22 Mar 2006 04:51:44 +0000
changeset 15740fd72308659e
parent 1573 2422ca15ba42
child 1575 3ba88cb7eb1b
Default to use the visibility attribute, on gcc (is this okay?)
configure.in
include/begin_code.h
     1.1 --- a/configure.in	Wed Mar 22 01:28:36 2006 +0000
     1.2 +++ b/configure.in	Wed Mar 22 04:51:44 2006 +0000
     1.3 @@ -719,7 +719,7 @@
     1.4      CFLAGS="$save_CFLAGS"
     1.5  
     1.6      if test x$have_gcc_fvisibility = xyes; then
     1.7 -        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS -DDECLSPEC=SDL_GCC_ATTR_VIS_DEFAULT"
     1.8 +        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
     1.9      fi
    1.10  }
    1.11  
     2.1 --- a/include/begin_code.h	Wed Mar 22 01:28:36 2006 +0000
     2.2 +++ b/include/begin_code.h	Wed Mar 22 04:51:44 2006 +0000
     2.3 @@ -31,44 +31,40 @@
     2.4  #endif
     2.5  #define _begin_code_h
     2.6  
     2.7 -#ifdef __GNUC__
     2.8 -#define SDL_GCC_ATTR_VIS_DEFAULT __attribute__((visibility("default")))
     2.9 -#endif
    2.10 -
    2.11  /* Some compilers use a special export keyword */
    2.12  #ifndef DECLSPEC
    2.13 -# ifdef __BEOS__
    2.14 +# if defined(__BEOS__)
    2.15  #  if defined(__GNUC__)
    2.16  #   define DECLSPEC	__declspec(dllexport)
    2.17  #  else
    2.18  #   define DECLSPEC	__declspec(export)
    2.19  #  endif
    2.20 -# else
    2.21 -# ifdef __WIN32__
    2.22 +# elif defined(__WIN32__)
    2.23  #  ifdef __BORLANDC__
    2.24  #   ifdef BUILD_SDL
    2.25  #    define DECLSPEC 
    2.26  #   else
    2.27 -#    define DECLSPEC __declspec(dllimport)
    2.28 +#    define DECLSPEC	__declspec(dllimport)
    2.29  #   endif
    2.30  #  else
    2.31  #   define DECLSPEC	__declspec(dllexport)
    2.32  #  endif
    2.33 -# else
    2.34 -# ifdef __OS2__
    2.35 +# elif defined(__OS2__)
    2.36  #  ifdef __WATCOMC__
    2.37  #   ifdef BUILD_SDL
    2.38 -#    define DECLSPEC __declspec(dllexport)
    2.39 +#    define DECLSPEC	__declspec(dllexport)
    2.40  #   else
    2.41 -#  define DECLSPEC
    2.42 -# endif
    2.43 +#    define DECLSPEC
    2.44 +#   endif
    2.45  #  else
    2.46  #   define DECLSPEC
    2.47  #  endif
    2.48  # else
    2.49 -#  define DECLSPEC
    2.50 -# endif
    2.51 -# endif
    2.52 +#  if defined(__GNUC__)
    2.53 +#   define DECLSPEC	__attribute__ ((visibility("default")))
    2.54 +#  else
    2.55 +#   define DECLSPEC
    2.56 +#  endif
    2.57  # endif
    2.58  #endif
    2.59