include/begin_code.h
changeset 0 74212992fb08
child 85 60c7960354e0
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/begin_code.h	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,86 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Library General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Library General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Library General Public
    1.19 +    License along with this library; if not, write to the Free
    1.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@devolution.com
    1.24 +*/
    1.25 +
    1.26 +/* This file sets things up for C dynamic library function definitions,
    1.27 +   static inlined functions, and structures aligned at 4-byte alignment.
    1.28 +   If you don't like ugly C preprocessor code, don't look at this file. :)
    1.29 +*/
    1.30 +
    1.31 +/* This shouldn't be nested -- included it around code only. */
    1.32 +#ifdef _begin_code_h
    1.33 +#error Nested inclusion of begin_code.h
    1.34 +#endif
    1.35 +#define _begin_code_h
    1.36 +
    1.37 +/* Some compilers use a special export keyword */
    1.38 +#ifndef DECLSPEC
    1.39 +# ifdef __BEOS__
    1.40 +#  if defined(__GNUC__)
    1.41 +#   define DECLSPEC	__declspec(dllexport)
    1.42 +#  else
    1.43 +#   define DECLSPEC	__declspec(export)
    1.44 +#  endif
    1.45 +# else
    1.46 +# ifdef WIN32
    1.47 +#  define DECLSPEC	__declspec(dllexport)
    1.48 +# else
    1.49 +#  define DECLSPEC
    1.50 +# endif
    1.51 +# endif
    1.52 +#endif
    1.53 +
    1.54 +/* Force structure packing at 4 byte alignment.
    1.55 +   This is necessary if the header is included in code which has structure
    1.56 +   packing set to an alternate value, say for loading structures from disk.
    1.57 +   The packing is reset to the previous value in close_code.h
    1.58 + */
    1.59 +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
    1.60 +#ifdef _MSC_VER
    1.61 +#pragma warning(disable: 4103)
    1.62 +#endif
    1.63 +#ifdef __BORLANDC__
    1.64 +#pragma nopackwarning
    1.65 +#endif
    1.66 +#pragma pack(push,4)
    1.67 +#endif /* Compiler needs structure packing set */
    1.68 +
    1.69 +/* Set up compiler-specific options for inlining functions */
    1.70 +#ifndef SDL_INLINE_OKAY
    1.71 +#ifdef __GNUC__
    1.72 +#define SDL_INLINE_OKAY
    1.73 +#else
    1.74 +/* Add any special compiler-specific cases here */
    1.75 +#if !defined(_MSC_VER) && !defined(__MRC__) && !defined(_SGI_SOURCE)
    1.76 +#define __inline__ inline
    1.77 +#define SDL_INLINE_OKAY
    1.78 +#endif /* Not a funky compiler */
    1.79 +#endif /* GNU C */
    1.80 +#endif /* SDL_INLINE_OKAY */
    1.81 +
    1.82 +/* If inlining isn't supported, remove "__inline__", turning static
    1.83 +   inlined functions into static functions (resulting in code bloat
    1.84 +   in all files which include the offending header files)
    1.85 +*/
    1.86 +#ifndef SDL_INLINE_OKAY
    1.87 +#define __inline__
    1.88 +#endif
    1.89 +