Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

types.h

Go to the documentation of this file.
00001 /*
00002   Copyright (C) 1997-2001 Shigeru Chiba, Tokyo Institute of Technology.
00003 
00004   Permission to use, copy, distribute and modify this software and   
00005   its documentation for any purpose is hereby granted without fee,        
00006   provided that the above copyright notice appear in all copies and that 
00007   both that copyright notice and this permission notice appear in 
00008   supporting documentation.
00009 
00010   Shigeru Chiba makes no representations about the suitability of this 
00011   software for any purpose.  It is provided "as is" without express or
00012   implied warranty.
00013 */
00014 
00015 /*
00016   Copyright (c) 1995, 1996 Xerox Corporation.
00017   All Rights Reserved.
00018 
00019   Use and copying of this software and preparation of derivative works
00020   based upon this software are permitted. Any copy of this software or
00021   of any derivative work must include the above copyright notice of
00022   Xerox Corporation, this paragraph and the one after it.  Any
00023   distribution of this software or derivative works must comply with all
00024   applicable United States export control laws.
00025 
00026   This software is made available AS IS, and XEROX CORPORATION DISCLAIMS
00027   ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE
00028   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029   PURPOSE, AND NOTWITHSTANDING ANY OTHER PROVISION CONTAINED HEREIN, ANY
00030   LIABILITY FOR DAMAGES RESULTING FROM THE SOFTWARE OR ITS USE IS
00031   EXPRESSLY DISCLAIMED, WHETHER ARISING IN CONTRACT, TORT (INCLUDING
00032   NEGLIGENCE) OR STRICT LIABILITY, EVEN IF XEROX CORPORATION IS ADVISED
00033   OF THE POSSIBILITY OF SUCH DAMAGES.
00034 */
00035 
00036 #ifndef _types_h
00037 #define _types_h
00038 
00039 // OpenC++ assumes that all standard C++ names are in the global namespace.
00040 using namespace std;
00041 
00042 #ifndef nil
00043 #define nil             0
00044 #endif
00045 
00046 #ifndef TRUE
00047 #define TRUE            1
00048 #define FALSE           0
00049 #endif
00050 
00051 // #define IRIX_CC      // If compiled under SGI Irix with CC (not g++)
00052 
00053 #if defined(_MSC_VER) && (_MSC_VER <= 1020)     // If MSVC version <= 4.2
00054 #pragma warning(disable:4237)           // to avoid warning related to bool
00055 typedef int bool;
00056 #endif
00057 
00058 typedef bool            BOOL;
00059 typedef int             sint;
00060 typedef unsigned int    uint;
00061 
00062 #if defined(sun) && (defined(sparc) || defined(__sparc))
00063 #  include <errno.h>
00064 #  ifdef ECHRNG
00065 #    define SUNOS5
00066 #  else
00067 #    define SUNOS4
00068 #  endif
00069 #endif
00070 
00071 #define USE_DLOADER             1
00072 
00073 #if !defined (_MSC_VER)
00074 #define USE_SO                  1
00075 #else
00076 #define USE_SO                  0       // Use DLL
00077 #endif
00078 
00079 #if USE_DLOADER && defined(_MSC_VER)
00080 #define OCXXMOP __declspec(dllexport)
00081 #pragma warning(disable:4275)
00082 #else
00083 #define OCXXMOP
00084 #endif
00085 
00086 #if (defined(__FreeBSD__) && __FreeBSD__ <= 2) || defined (__OpenBSD__) || defined (__NetBSD__)
00087 #define DLSYM_NEED_UNDERSCORE   1
00088 #define SHARED_OPTION           0
00089 #else   // Solaris, SunOS, Linux, Irix, FreeBSD 3.x
00090 #define DLSYM_NEED_UNDERSCORE   0
00091 #define SHARED_OPTION           1
00092 #endif
00093 
00094 #if USE_DLOADER && USE_SO
00095 #include <dlfcn.h>
00096 
00097 // Some operating systems like FreeBSD and SunOS do not define RTLD_GLOBAL
00098 // or RTLD_LAZY
00099 
00100 #ifndef RTLD_LAZY
00101 #define RTLD_LAZY               1
00102 #endif
00103 
00104 #ifndef RTLD_GLOBAL
00105 #define RTLD_GLOBAL             0
00106 #endif
00107 
00108 #endif /* USE_DLOADER */
00109 
00110 /*
00111   class Object is the root of all classes. If a garbage collector
00112   is used, Object is an alias of gc_cleanup.
00113 */
00114 #ifdef DONT_GC
00115 
00116 #include <string.h>             // For size_t
00117 
00118 class LightObject {};
00119 class Object {};
00120 enum GCPlacement {GC, NoGC};
00121 
00122 inline void* operator new(size_t size, GCPlacement gcp)
00123 {
00124     return ::operator new(size);
00125 }
00126 
00127 inline void* operator new [](size_t size, GCPlacement gcp)
00128 {
00129     return ::operator new [](size);
00130 }
00131 
00132 #else
00133 
00134 #include "gc/gc_cpp.h"
00135 typedef gc LightObject;
00136 typedef gc_cleanup Object;
00137 
00138 #endif
00139 
00140 #endif /* _types_h */

Generated on Mon Feb 10 17:32:59 2003 for VFiasco Semantics Compiler by doxygen1.2.15