misc/winutils/include/begin_code.h
author koda
Wed, 02 May 2012 16:36:11 +0100
changeset 6999 486db9d26e4b
parent 6560 ca07e6be08d0
child 7809 7d4fb2f35f4f
permissions -rw-r--r--
rename a few Draw* routines
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     1
/*
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     2
    SDL - Simple DirectMedia Layer
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     3
    Copyright (C) 1997-2009 Sam Lantinga
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     4
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     5
    This library is free software; you can redistribute it and/or
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     6
    modify it under the terms of the GNU Library General Public
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     7
    License as published by the Free Software Foundation; either
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     8
    version 2 of the License, or (at your option) any later version.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     9
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    10
    This library is distributed in the hope that it will be useful,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    13
    Library General Public License for more details.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    14
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    15
    You should have received a copy of the GNU Library General Public
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    16
    License along with this library; if not, write to the Free
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    18
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    19
    Sam Lantinga
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    20
    slouken@libsdl.org
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    21
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    22
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    23
/** 
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    24
 *  @file begin_code.h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    25
 *  This file sets things up for C dynamic library function definitions,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    26
 *  static inlined functions, and structures aligned at 4-byte alignment.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    27
 *  If you don't like ugly C preprocessor code, don't look at this file. :)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    28
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    29
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    30
/** 
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    31
 *  @file begin_code.h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    32
 *  This shouldn't be nested -- included it around code only.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    33
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    34
#ifdef _begin_code_h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    35
#error Nested inclusion of begin_code.h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    36
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    37
#define _begin_code_h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    38
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    39
/** 
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    40
 *  @def DECLSPEC
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    41
 *  Some compilers use a special export keyword
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    42
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    43
#ifndef DECLSPEC
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    44
# if defined(__BEOS__) || defined(__HAIKU__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    45
#  if defined(__GNUC__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    46
#   define DECLSPEC	__declspec(dllexport)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    47
#  else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    48
#   define DECLSPEC	__declspec(export)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    49
#  endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    50
# elif defined(__WIN32__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    51
#  ifdef __BORLANDC__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    52
#   ifdef BUILD_SDL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    53
#    define DECLSPEC 
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    54
#   else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    55
#    define DECLSPEC	__declspec(dllimport)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    56
#   endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    57
#  else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    58
#   define DECLSPEC	__declspec(dllexport)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    59
#  endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    60
# elif defined(__OS2__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    61
#  ifdef __WATCOMC__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    62
#   ifdef BUILD_SDL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    63
#    define DECLSPEC	__declspec(dllexport)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    64
#   else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    65
#    define DECLSPEC
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    66
#   endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    67
#  elif defined (__GNUC__) && __GNUC__ < 4
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    68
#   /* Added support for GCC-EMX <v4.x */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    69
#   /* this is needed for XFree86/OS2 developement */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    70
#   /* F. Ambacher(anakor@snafu.de) 05.2008 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    71
#   ifdef BUILD_SDL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    72
#    define DECLSPEC    __declspec(dllexport)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    73
#   else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    74
#    define DECLSPEC
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    75
#   endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    76
#  else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    77
#   define DECLSPEC
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    78
#  endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    79
# else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    80
#  if defined(__GNUC__) && __GNUC__ >= 4
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    81
#   define DECLSPEC	__attribute__ ((visibility("default")))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    82
#  else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    83
#   define DECLSPEC
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    84
#  endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    85
# endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    86
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    87
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    88
/** 
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    89
 *  @def SDLCALL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    90
 *  By default SDL uses the C calling convention
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    91
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    92
#ifndef SDLCALL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    93
# if defined(__WIN32__) && !defined(__GNUC__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    94
#  define SDLCALL __cdecl
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    95
# elif defined(__OS2__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    96
#  if defined (__GNUC__) && __GNUC__ < 4
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    97
#   /* Added support for GCC-EMX <v4.x */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    98
#   /* this is needed for XFree86/OS2 developement */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    99
#   /* F. Ambacher(anakor@snafu.de) 05.2008 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   100
#   define SDLCALL _cdecl
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   101
#  else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   102
#   /* On other compilers on OS/2, we use the _System calling convention */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   103
#   /* to be compatible with every compiler */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   104
#   define SDLCALL _System
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   105
#  endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   106
# else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   107
#  define SDLCALL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   108
# endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   109
#endif /* SDLCALL */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   110
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   111
#ifdef __SYMBIAN32__ 
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   112
#ifndef EKA2 
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   113
#undef DECLSPEC
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   114
#define DECLSPEC
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   115
#elif !defined(__WINS__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   116
#undef DECLSPEC
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   117
#define DECLSPEC __declspec(dllexport)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   118
#endif /* !EKA2 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   119
#endif /* __SYMBIAN32__ */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   120
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   121
/**
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   122
 *  @file begin_code.h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   123
 *  Force structure packing at 4 byte alignment.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   124
 *  This is necessary if the header is included in code which has structure
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   125
 *  packing set to an alternate value, say for loading structures from disk.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   126
 *  The packing is reset to the previous value in close_code.h 
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   127
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   128
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   129
#ifdef _MSC_VER
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   130
#pragma warning(disable: 4103)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   131
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   132
#ifdef __BORLANDC__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   133
#pragma nopackwarning
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   134
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   135
#pragma pack(push,4)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   136
#elif (defined(__MWERKS__) && defined(__MACOS__))
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   137
#pragma options align=mac68k4byte
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   138
#pragma enumsalwaysint on
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   139
#endif /* Compiler needs structure packing set */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   140
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   141
/**
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   142
 *  @def SDL_INLINE_OKAY
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   143
 *  Set up compiler-specific options for inlining functions
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   144
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   145
#ifndef SDL_INLINE_OKAY
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   146
#ifdef __GNUC__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   147
#define SDL_INLINE_OKAY
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   148
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   149
/* Add any special compiler-specific cases here */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   150
#if defined(_MSC_VER) || defined(__BORLANDC__) || \
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   151
    defined(__DMC__) || defined(__SC__) || \
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   152
    defined(__WATCOMC__) || defined(__LCC__) || \
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   153
    defined(__DECC) || defined(__EABI__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   154
#ifndef __inline__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   155
#define __inline__	__inline
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   156
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   157
#define SDL_INLINE_OKAY
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   158
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   159
#if !defined(__MRC__) && !defined(_SGI_SOURCE)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   160
#ifndef __inline__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   161
#define __inline__ inline
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   162
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   163
#define SDL_INLINE_OKAY
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   164
#endif /* Not a funky compiler */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   165
#endif /* Visual C++ */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   166
#endif /* GNU C */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   167
#endif /* SDL_INLINE_OKAY */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   168
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   169
/**
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   170
 *  @def __inline__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   171
 *  If inlining isn't supported, remove "__inline__", turning static
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   172
 *  inlined functions into static functions (resulting in code bloat
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   173
 *  in all files which include the offending header files)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   174
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   175
#ifndef SDL_INLINE_OKAY
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   176
#define __inline__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   177
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   178
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   179
/**
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   180
 *  @def NULL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   181
 *  Apparently this is needed by several Windows compilers
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   182
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   183
#if !defined(__MACH__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   184
#ifndef NULL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   185
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   186
#define NULL 0
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   187
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   188
#define NULL ((void *)0)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   189
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   190
#endif /* NULL */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   191
#endif /* ! Mac OS X - breaks precompiled headers */