CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

cssysdef.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 1998-2001 by Jorrit Tyberghein
00003     Written by Andrew Zabolotny <bit@eltech.ru>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifdef __CS_CSSYSDEFS_H__
00021 #error Do not include cssysdef.h from header files please!
00022 #else
00023 #define __CS_CSSYSDEFS_H__
00024 
00025 #define CSDEF_FRIEND
00026 #include "csdef.h"
00027 #undef CSDEF_FRIEND
00028 
00070 /*
00071  * Pull in platform-specific overrides of the requested functionality.
00072  */
00073 #include "cssys/csosdefs.h"
00074 
00075 /*
00076  * Default definitions for requested functionality.  Platform-specific
00077  * configuration files may override these.
00078  */
00079 
00083 #ifdef CS_SYSDEF_PROVIDE_TEMP
00084 #  ifndef TEMP_DIR
00085 #    if defined(OS_UNIX)
00086 #      define TEMP_DIR "/tmp/"
00087 #    else
00088 #      define TEMP_DIR ""
00089 #    endif
00090 #  endif
00091 #  ifndef TEMP_FILE
00092 #    if defined(OS_UNIX)
00093 #      include <unistd.h>
00095 #      define TEMP_FILE "cs%lud.tmp", (unsigned long)getpid()
00096 #    else
00097 
00098 #      define TEMP_FILE "$cs$.tmp"
00099 #    endif
00100 #  endif
00101 #endif // CS_SYSDEF_PROVIDE_TEMP
00102 
00106 #ifdef CS_SYSDEF_PROVIDE_MKDIR
00107 #  ifndef MKDIR
00108 #    if defined(OS_WIN32) || (defined(OS_DOS) && !defined(COMP_GCC))
00109 #      define MKDIR(path) _mkdir (path)
00110 #    else
00111 #      define MKDIR(path) mkdir (path, 0755)
00112 #    endif
00113 #  endif
00114 #endif // CS_SYSDEF_PROVIDE_MKDIR
00115 
00116 #ifdef CS_SYSDEF_PROVIDE_GETCWD
00117 #  if !defined(COMP_VC) && !defined(COMP_BC)
00118 #    include <unistd.h>
00119 #  endif
00120 #endif // CS_SYSDEF_PROVIDE_GETCWD
00121 
00122 #ifdef CS_SYSDEF_PROVIDE_DIR
00123 // For systems without opendir()
00124 // COMP_GCC has opendir, readdir 
00125 # if !defined(COMP_GCC)
00126 #  if defined(__NEED_OPENDIR_PROTOTYPE)
00127      struct DIR;
00128      struct dirent;
00129      extern "C" DIR *opendir (const char *name);
00130      extern "C" dirent *readdir (DIR *dirp);
00131      extern "C" int closedir (DIR *dirp);
00132      //extern "C" void seekdir (DIR *dirp, long off);
00133      //extern "C" long telldir (DIR *dirp);
00134      //extern "C" void rewinddir (DIR *dirp);
00135 #  endif
00136 # endif
00137 // Generic ISDIR needed for COMP_GCC
00138 #  ifdef __NEED_GENERIC_ISDIR
00139 #    if defined (OS_WIN32) || defined (OS_DOS)
00140 #      include <io.h>
00141 #    endif
00142 #    include <sys/types.h>
00143 #    if !defined(OS_WIN32)
00144 #      include <dirent.h>
00145 #    endif
00146 #    if defined(__CYGWIN32__)
00147 #      include <sys/dirent.h>
00148 #    endif
00149 #    include <sys/stat.h>
00150      static inline bool isdir (const char *path, struct dirent *de)
00151      {
00152        char fullname [CS_MAXPATHLEN];
00153        int pathlen = strlen (path);
00154        memcpy (fullname, path, pathlen + 1);
00155        
00156        if ((pathlen) && (fullname[pathlen-1] != PATH_SEPARATOR))
00157        {
00158    fullname[pathlen++] = PATH_SEPARATOR;
00159    fullname[pathlen] = 0;
00160        }
00161               
00162        strcat (&fullname [pathlen], de->d_name);
00163        struct stat st;
00164        stat (fullname, &st);
00165        return ((st.st_mode & S_IFMT) == S_IFDIR);
00166      }
00167 #  endif
00168 #endif // CS_SYSDEF_PROVIDE_DIR
00169 
00170 #ifdef CS_SYSDEF_PROVIDE_UNLINK
00171 #  if !defined(COMP_VC) && !defined(COMP_BC)
00172 #    include <unistd.h>
00173 #  endif
00174 #endif
00175 
00182 #ifdef COMP_GCC
00183 // In GCC we are able to declare stack vars of dynamic size directly
00184 #  define CS_ALLOC_STACK_ARRAY(type, var, size) \
00185       type var [size]
00186 #else
00187 #  include <malloc.h>
00188 #  define CS_ALLOC_STACK_ARRAY(type, var, size) \
00189       type *var = (type *)alloca ((size) * sizeof (type))
00190 #endif
00191 
00192 #ifdef CS_SYSDEF_PROVIDE_ACCESS
00193 #  if !defined(COMP_VC) && !defined(COMP_BC)
00194 #    include <unistd.h>
00195 #  endif
00196 #  ifndef F_OK
00197 #    define F_OK 0
00198 #  endif
00199 #  ifndef R_OK
00200 #    define R_OK 2
00201 #  endif
00202 #  ifndef W_OK
00203 #    define W_OK 4
00204 #  endif
00205 #endif
00206 
00207 #ifdef CS_SYSDEF_PROVIDE_GETOPT
00208 #  ifndef __STDC__
00209 #    define __STDC__ 1
00210 #  endif
00211 #  include "cssys/getopt.h"
00212 #endif
00213 
00214 #ifdef CS_SYSDEF_PROVIDE_SOCKETS
00215 # ifdef __GNUC__
00216 #  warning CS_SYSDEF_PROVIDE_SOCKETS is deprecated, include cssys/sockets.h instead
00217 # endif
00218 #include "cssys/sockets.h"
00219 #endif
00220 
00221 #ifdef CS_SYSDEF_PROVIDE_SELECT
00222 #  include <sys/select.h>
00223 #endif
00224 
00240 #define CS_HEADER_GLOBAL(X,Y) CS_HEADER_GLOBAL_COMPOSE(X,Y)
00241 #define CS_HEADER_GLOBAL_COMPOSE(X,Y) <X/Y>
00242 
00255 #define CS_HEADER_LOCAL(X,Y) CS_HEADER_LOCAL_COMPOSE1(X,Y)
00256 #define CS_HEADER_LOCAL_COMPOSE1(X,Y) CS_HEADER_LOCAL_COMPOSE2(X/Y)
00257 #define CS_HEADER_LOCAL_COMPOSE2(X) #X
00258 
00259 
00265 #if !defined(CS_EXPORTED_FUNCTION)
00266 #  define CS_EXPORTED_FUNCTION extern "C"
00267 #endif
00268 
00280 #if !defined(CS_EXPORTED_NAME)
00281 #  define CS_EXPORTED_NAME(Prefix, Suffix) Prefix ## Suffix
00282 #endif
00283 
00284 #ifndef CS_IMPLEMENT_PLATFORM_PLUGIN
00285 #  define CS_IMPLEMENT_PLATFORM_PLUGIN
00286 #endif
00287 
00288 #ifndef CS_IMPLEMENT_PLATFORM_APPLICATION
00289 #  define CS_IMPLEMENT_PLATFORM_APPLICATION
00290 #endif
00291 
00292 #ifndef CS_STATIC_VAR_DESTRUCTION_REGISTRAR_FUNCTION
00293 #  define CS_STATIC_VAR_DESTRUCTION_REGISTRAR_FUNCTION cs_static_var_cleanup
00294 #endif
00295 
00296 #ifndef CS_DECLARE_STATIC_VARIABLE_REGISTRATION
00297 #  define CS_DECLARE_STATIC_VARIABLE_REGISTRATION \
00298 void CS_STATIC_VAR_DESTRUCTION_REGISTRAR_FUNCTION (void (*p)());
00299 #endif
00300 
00301 #ifndef CS_DECLARE_STATIC_VARIABLE_CLEANUP
00302 #  define CS_DECLARE_STATIC_VARIABLE_CLEANUP \
00303    CS_DECLARE_STATIC_VARIABLE_REGISTRATION
00304 #endif
00305 
00306 #ifndef CS_IMPLEMENT_STATIC_VARIABLE_REGISTRATION
00307 #  define CS_IMPLEMENT_STATIC_VARIABLE_REGISTRATION                    \
00308 void CS_STATIC_VAR_DESTRUCTION_REGISTRAR_FUNCTION (void (*p)())        \
00309 {                                                                      \
00310   static void (**a)()=0;                                               \
00311   static int lastEntry=0;                                              \
00312   static int maxEntries=0;                                             \
00313                                                                        \
00314   if (p)                                                               \
00315   {                                                                    \
00316     if (lastEntry >= maxEntries)                                       \
00317     {                                                                  \
00318       maxEntries+=10;                                                  \
00319       a = (void (**)())realloc (a, maxEntries*sizeof(void*));          \
00320     }                                                                  \
00321     a[lastEntry++] = p;                                                \
00322   }                                                                    \
00323   else                                                                 \
00324   {                                                                    \
00325     int i;                                                             \
00326     for (i=lastEntry-1; i >= 0; i--)                                   \
00327       a[i] ();                                                         \
00328     free (a);                                                          \
00329    }                                                                   \
00330 }                                                                      
00331 #endif
00332 
00333 #ifndef CS_IMPLEMENT_STATIC_VARIABLE_CLEANUP
00334 #  define CS_IMPLEMENT_STATIC_VARIABLE_CLEANUP \
00335    CS_IMPLEMENT_STATIC_VARIABLE_REGISTRATION   
00336 #endif
00337 
00346 #if defined(CS_STATIC_LINKED)
00347 
00348 #  ifndef CS_IMPLEMENT_PLUGIN
00349 #  define CS_IMPLEMENT_PLUGIN        \
00350           CS_IMPLEMENT_PLATFORM_PLUGIN 
00351 #  endif
00352 
00353 #else
00354 
00355 #  ifndef CS_IMPLEMENT_PLUGIN
00356 #  define CS_IMPLEMENT_PLUGIN              \
00357    CS_IMPLEMENT_STATIC_VARIABLE_CLEANUP    \
00358    CS_IMPLEMENT_PLATFORM_PLUGIN 
00359 #  endif
00360 
00361 #endif
00362 
00370 #ifndef CS_IMPLEMENT_APPLICATION
00371 #  define CS_IMPLEMENT_APPLICATION       \
00372    CS_IMPLEMENT_STATIC_VARIABLE_CLEANUP  \
00373    CS_IMPLEMENT_PLATFORM_APPLICATION 
00374 #endif
00375 
00379 #ifndef CS_REGISTER_STATIC_FOR_DESTRUCTION
00380 #define CS_REGISTER_STATIC_FOR_DESTRUCTION(getterFunc)\
00381         CS_STATIC_VAR_DESTRUCTION_REGISTRAR_FUNCTION (getterFunc);
00382 #endif
00383 
00387 #ifndef CS_STATIC_VARIABLE_CLEANUP
00388 #define CS_STATIC_VARIABLE_CLEANUP  \
00389         CS_STATIC_VAR_DESTRUCTION_REGISTRAR_FUNCTION (0);
00390 #endif
00391 
00402 #ifndef CS_IMPLEMENT_STATIC_VAR_EXT
00403 #define CS_IMPLEMENT_STATIC_VAR_EXT(getterFunc,Type,initParam,kill_how) \
00404 CS_DECLARE_STATIC_VARIABLE_REGISTRATION                                 \
00405 extern "C" {                                                            \
00406 static Type* getterFunc ();                                             \
00407 static void getterFunc ## _kill ();                                     \
00408 static void getterFunc ## _kill_array ();                               \
00409 void getterFunc ## _kill ()                                             \
00410 {                                                                       \
00411   (void)getterFunc ## _kill_array;                                      \
00412   delete getterFunc ();                                                 \
00413 }                                                                       \
00414 void getterFunc ## _kill_array ()                                       \
00415 {                                                                       \
00416   (void)getterFunc ## _kill;                                            \
00417   delete [] getterFunc ();                                              \
00418 }                                                                       \
00419 Type* getterFunc ()                                                     \
00420 {                                                                       \
00421   static Type *v=0;                                                     \
00422   if (!v)                                                               \
00423   {                                                                     \
00424     v = new Type initParam;                                             \
00425     CS_REGISTER_STATIC_FOR_DESTRUCTION (getterFunc ## kill_how);        \
00426   }                                                                     \
00427   return v;                                                             \
00428 }                                                                       \
00429 }
00430 #endif
00431 
00432 #ifndef CS_IMPLEMENT_STATIC_VAR
00433 #define CS_IMPLEMENT_STATIC_VAR(getterFunc,Type,initParam)    \
00434  CS_IMPLEMENT_STATIC_VAR_EXT(getterFunc,Type,initParam,_kill)    
00435 #endif
00436 
00437 #ifndef CS_IMPLEMENT_STATIC_VAR_ARRAY
00438 #define CS_IMPLEMENT_STATIC_VAR_ARRAY(getterFunc,Type,initParam)    \
00439  CS_IMPLEMENT_STATIC_VAR_EXT(getterFunc,Type,initParam,_kill_array)    
00440 #endif
00441 
00447 #ifndef CS_DECLARE_STATIC_CLASSVAR
00448 #define CS_DECLARE_STATIC_CLASSVAR(var,getterFunc,Type)       \
00449 static Type *var;                                             \
00450 static Type *getterFunc ();                                   
00451 #endif
00452 
00453 #ifndef CS_DECLARE_STATIC_CLASSVAR_REF
00454 #define CS_DECLARE_STATIC_CLASSVAR_REF(var,getterFunc,Type)   \
00455 static Type *var;                                             \
00456 static Type &getterFunc ();                                   
00457 #endif
00458 
00468 #ifndef CS_IMPLEMENT_STATIC_CLASSVAR_EXT
00469 #define CS_IMPLEMENT_STATIC_CLASSVAR_EXT(Class,var,getterFunc,Type,initParam,kill_how)   \
00470 Type *Class::var = 0;                                                                    \
00471 extern "C" {                                                                             \
00472 static void Class ## _ ## getterFunc ## _kill ();                                        \
00473 static void Class ## _ ## getterFunc ## _kill_array ();                                  \
00474 void Class ## _ ## getterFunc ## _kill ()                                                \
00475 {                                                                                        \
00476   (void) Class ## _ ## getterFunc ## _kill_array;                                        \
00477   delete Class::getterFunc ();                                                           \
00478 }                                                                                        \
00479 void Class ## _ ## getterFunc ## _kill_array ()                                          \
00480 {                                                                                        \
00481   (void) Class ## _ ## getterFunc ## _kill;                                              \
00482   delete [] Class::getterFunc ();                                                        \
00483 }                                                                                        \
00484 }                                                                                        \
00485 Type* Class::getterFunc ()                                                               \
00486 {                                                                                        \
00487   if (!var)                                                                              \
00488   {                                                                                      \
00489     var = new Type initParam;                                                            \
00490     CS_DECLARE_STATIC_VARIABLE_REGISTRATION                                              \
00491     CS_REGISTER_STATIC_FOR_DESTRUCTION (Class ## _ ## getterFunc ## kill_how);           \
00492   }                                                                                      \
00493   return var;                                                                            \
00494 }
00495 #endif
00496 
00497 #ifndef CS_IMPLEMENT_STATIC_CLASSVAR
00498 #define CS_IMPLEMENT_STATIC_CLASSVAR(Class,var,getterFunc,Type,initParam) \
00499         CS_IMPLEMENT_STATIC_CLASSVAR_EXT(Class,var,getterFunc,Type,initParam,_kill)
00500 #endif
00501 
00502 #ifndef CS_IMPLEMENT_STATIC_CLASSVAR_ARRAY
00503 #define CS_IMPLEMENT_STATIC_CLASSVAR_ARRAY(Class,var,getterFunc,Type,initParam) \
00504         CS_IMPLEMENT_STATIC_CLASSVAR_EXT(Class,var,getterFunc,Type,initParam,_kill_array)
00505 #endif
00506 
00507 #ifndef CS_IMPLEMENT_STATIC_CLASSVAR_REF_EXT
00508 #define CS_IMPLEMENT_STATIC_CLASSVAR_REF_EXT(Class,var,getterFunc,Type,initParam,kill_how)   \
00509 Type *Class::var = 0;                                                                        \
00510 extern "C" {                                                                                 \
00511 static void Class ## _ ## getterFunc ## _kill ();                                            \
00512 static void Class ## _ ## getterFunc ## _kill_array ();                                      \
00513 void Class ## _ ## getterFunc ## _kill ()                                                    \
00514 {                                                                                            \
00515   (void) Class ## _ ## getterFunc ## _kill_array;                                            \
00516   delete &Class::getterFunc ();                                                              \
00517 }                                                                                            \
00518 void Class ## _ ## getterFunc ## _kill_array ()                                              \
00519 {                                                                                            \
00520   (void) Class ## _ ## getterFunc ## _kill;                                                  \
00521   delete [] &Class::getterFunc ();                                                           \
00522 }                                                                                            \
00523 }                                                                                            \
00524 Type &Class::getterFunc ()                                                                   \
00525 {                                                                                            \
00526   if (!var)                                                                                  \
00527   {                                                                                          \
00528     var = new Type initParam;                                                                \
00529     CS_DECLARE_STATIC_VARIABLE_REGISTRATION                                                  \
00530     CS_REGISTER_STATIC_FOR_DESTRUCTION (Class ## _ ## getterFunc ## kill_how);               \
00531   }                                                                                          \
00532   return *var;                                                                               \
00533 }
00534 #endif
00535 
00536 #ifndef CS_IMPLEMENT_STATIC_CLASSVAR_REF
00537 #define CS_IMPLEMENT_STATIC_CLASSVAR_REF(Class,var,getterFunc,Type,initParam)   \
00538         CS_IMPLEMENT_STATIC_CLASSVAR_REF_EXT(Class,var,getterFunc,Type,initParam,_kill)
00539 #endif
00540 
00541 #ifndef CS_IMPLEMENT_STATIC_CLASSVAR_REF_ARRAY
00542 #define CS_IMPLEMENT_STATIC_CLASSVAR_REF_ARRAY(Class,var,getterFunc,Type,initParam)   \
00543         CS_IMPLEMENT_STATIC_CLASSVAR_REF_EXT(Class,var,getterFunc,Type,initParam,_kill_array)
00544 #endif
00545 
00546 // The following define should only be enabled if you have defined
00547 // a special version of overloaded new that accepts two additional
00548 // parameters: a (void*) pointing to the filename and an int with the
00549 // line number. This is typically used for memory debugging.
00550 // In csutil/memdebug.cpp there is a memory debugger which can (optionally)
00551 // use this feature. Note that if CS_EXTENSIVE_MEMDEBUG is enabled while
00552 // the memory debugger is not the memory debugger will still provide the
00553 // needed overloaded operators so you can leave CS_EXTENSIVE_MEMDEBUG on in
00554 // that case and the only overhead will be a little more arguments to 'new'.
00555 // Do not enable CS_EXTENSIVE_MEMDEBUG if your platform or your own code
00556 // defines its own 'new' operator, since this version will interfere with your
00557 // own.
00558 #ifndef CS_DEBUG
00559 #  undef CS_EXTENSIVE_MEMDEBUG
00560 #endif
00561 #ifdef CS_EXTENSIVE_MEMDEBUG
00562 extern void* operator new (size_t s, void* filename, int line);
00563 extern void* operator new[] (size_t s, void* filename, int line);
00564 #define CS_EXTENSIVE_MEMDEBUG_NEW new ((void*)__FILE__, __LINE__)
00565 #define new CS_EXTENSIVE_MEMDEBUG_NEW
00566 #endif
00567 
00568 #ifdef CS_DEBUG
00569 #  if !defined (DEBUG_BREAK)
00570 #    if defined (PROC_X86)
00571 #      if defined (COMP_GCC)
00572 #        define DEBUG_BREAK asm ("int $3")
00573 #      else
00574 #        define DEBUG_BREAK _asm int 3
00575 #      endif
00576 #    else
00577 #      define DEBUG_BREAK { static int x = 0; x /= x; }
00578 #    endif
00579 #  endif
00580 #  if !defined (CS_ASSERT)
00581 #    if defined (COMP_VC)
00582 #      define  CS_ASSERT(x) assert(x)
00583 #    else
00584 #      include <stdio.h>
00585 #      define CS_ASSERT(x)            \
00586          if (!(x))              \
00587          {                \
00588            fprintf (stderr, __FILE__ ":%d: failed assertion '%s'\n",\
00589              int(__LINE__), #x );         \
00590            DEBUG_BREAK;             \
00591          }
00592 #    endif
00593 #  endif
00594 #else
00595 #  undef DEBUG_BREAK
00596 #  define DEBUG_BREAK
00597 #  undef CS_ASSERT
00598 #  define CS_ASSERT(x)
00599 #endif
00600 
00601 // Check if the csosdefs.h defined either CS_LITTLE_ENDIAN or CS_BIG_ENDIAN
00602 #if !defined (CS_LITTLE_ENDIAN) && !defined (CS_BIG_ENDIAN)
00603 #  error No CS_XXX_ENDIAN macro defined in your OS-specific csosdefs.h!
00604 #endif
00605 
00606 /*
00607  * This is a bit of overkill but if you're sure your CPU doesn't require
00608  * strict alignment add your CPU to the !defined below to get slightly
00609  * smaller and faster code in some cases.
00610  *
00611  * @@@ In the future, this should be moved to volatile.h and determined as
00612  * part of the configuration process.
00613  */
00614 #if !defined (PROC_X86)
00615 #  define CS_STRICT_ALIGNMENT
00616 #endif
00617 
00618 // Adjust some definitions contained in volatile.h
00619 #if defined (PROC_X86) && !defined (DO_NASM)
00620 #  undef NO_ASSEMBLER
00621 #  define NO_ASSEMBLER
00622 #endif
00623 
00624 #if !defined (PROC_X86) || defined (NO_ASSEMBLER)
00625 #  undef DO_MMX
00626 #  undef DO_NASM
00627 #endif
00628 
00629 // Use fast QInt and QRound on CPUs that are known to support it
00630 #if !defined (CS_NO_IEEE_OPTIMIZATIONS)
00631 #  if !defined (CS_IEEE_DOUBLE_FORMAT)
00632 #    if defined (PROC_X86) || defined (PROC_M68K)
00633 #      define CS_IEEE_DOUBLE_FORMAT
00634 #    endif
00635 #  endif
00636 #endif
00637 
00638 // gcc can perform usefull checking for printf/scanf format strings, just add
00639 // this define at the end of the function declaration
00640 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
00641 #  define CS_GNUC_PRINTF( format_idx, arg_idx)    \
00642      __attribute__((format (printf, format_idx, arg_idx)))
00643 #  define CS_GNUC_SCANF( format_idx, arg_idx )        \
00644      __attribute__((format (scanf, format_idx, arg_idx)))
00645 #else
00646 #  define CS_GNUC_PRINTF( format_idx, arg_idx )
00647 #  define CS_GNUC_SCANF( format_idx, arg_idx )
00648 #endif
00649 
00650 // remove __attribute__ on non GNUC compilers
00651 #ifndef __GNUC__
00652 #define __attribute__(x)
00653 #endif
00654 
00655 // Support for alignment and packing of structures.
00656 #if !defined(CS_STRUCT_ALIGN_4BYTE_BEGIN)
00657 #  if defined(__GNUC__) && defined(CS_STRICT_ALIGNMENT)
00658 #    define CS_STRUCT_ALIGN_4BYTE_BEGIN
00659 #    define CS_STRUCT_ALIGN_4BYTE_END __attribute__ ((aligned(4)))
00660 #  else
00661 #    define CS_STRUCT_ALIGN_4BYTE_BEGIN
00662 #    define CS_STRUCT_ALIGN_4BYTE_END
00663 #  endif
00664 #endif
00665 
00666 // Macro used to define static implicit pointer conversion function.
00667 // Only use within a class declaration.
00668 #ifndef _CS_IMPLICITPTRCAST_NAME
00669 #  define _CS_IMPLICITPTRCAST_NAME __ImplicitPtrCast
00670 #endif
00671 
00693 #define CS_IMPLEMENT_IMPLICIT_PTR_CAST(classname) \
00694   inline static classname* _CS_IMPLICITPTRCAST_NAME (classname* ptr) \
00695   { \
00696     return ptr;\
00697   }
00698 
00707 #define CS_IMPLICIT_PTR_CAST(classname, ptr) \
00708   (classname::_CS_IMPLICITPTRCAST_NAME(ptr))
00709 
00711 extern void (*fatal_exit) (int errorcode, bool canreturn);
00712 
00713 #endif // __CS_CSSYSDEFS_H__

Generated for Crystal Space by doxygen 1.2.14