json_defs.h

Go to the documentation of this file.
00001 
00002 // Name:        json_defs.h
00003 // Purpose:     shared build defines
00004 // Author:      Luciano Cattani
00005 // Created:     2007/10/20
00006 // RCS-ID:      $Id: json_defs.h,v 1.6 2008/03/12 10:48:19 luccat Exp $
00007 // Copyright:   (c) 2007 Luciano Cattani
00008 // Licence:     wxWidgets licence
00010 
00011 
00012 #ifndef _WX_JSON_DEFS_H_
00013 #define _WX_JSON_DEFS_H_
00014 
00015 // Defines for component version.
00016 // The following symbols should be updated for each new component release
00017 // since some kind of tests, like those of AM_WXCODE_CHECKFOR_COMPONENT_VERSION()
00018 // for "configure" scripts under unix, use them.
00019 #define wxJSON_MAJOR          1
00020 #define wxJSON_MINOR          0
00021 #define wxJSON_RELEASE        0
00022 
00023 // For non-Unix systems (i.e. when building without a configure script),
00024 // users of this component can use the following macro to check if the
00025 // current version is at least major.minor.release
00026 #define wxCHECK_JSON_VERSION(major,minor,release) \
00027     (wxJSON_MAJOR > (major) || \
00028     (wxJSON_MAJOR == (major) && wxJSON_MINOR > (minor)) || \
00029     (wxJSON_MAJOR == (major) && wxJSON_MINOR == (minor) && wxJSON_RELEASE >= (release)))
00030 
00031 
00032 // Defines for shared builds.
00033 // Simple reference for using these macros and for writin components
00034 // which support shared builds:
00035 //
00036 // 1) use the WXDLLIMPEXP_MYCOMP in each class declaration:
00037 //          class WXDLLIMPEXP_MYCOMP myCompClass {   [...]   };
00038 //
00039 // 2) use the WXDLLIMPEXP_MYCOMP in the declaration of each global function:
00040 //          WXDLLIMPEXP_MYCOMP int myGlobalFunc();
00041 //
00042 // 3) use the WXDLLIMPEXP_DATA_MYCOMP() in the declaration of each global
00043 //    variable:
00044 //          WXDLLIMPEXP_DATA_MYCOMP(int) myGlobalIntVar;
00045 //
00046 #ifdef WXMAKINGDLL_JSON
00047     #define WXDLLIMPEXP_JSON                  WXEXPORT
00048     #define WXDLLIMPEXP_DATA_JSON(type)       WXEXPORT type
00049 #elif defined(WXUSINGDLL)
00050     #define WXDLLIMPEXP_JSON                  WXIMPORT
00051     #define WXDLLIMPEXP_DATA_JSON(type)       WXIMPORT type
00052 #else // not making nor using DLL
00053     #define WXDLLIMPEXP_JSON
00054     #define WXDLLIMPEXP_DATA_JSON(type)     type
00055 #endif
00056 
00057 // the __PRETTY_FUNCTION__ macro expands to the full class's
00058 // member name in the GNU GCC.
00059 // For other compilers we use the standard __wxFUNCTION__ macro
00060 #if !defined( __GNUC__ )
00061   #define __PRETTY_FUNCTION__   __WXFUNCTION__
00062 #endif
00063 
00064 
00065 
00066 // define wxJSON_USE_UNICODE if wxWidgets was built with
00067 // unicode support
00068 #if defined( wxJSON_USE_UNICODE )
00069   #undef wxJSON_USE_UNICODE
00070 #endif
00071 
00072 // do not modify the following lines
00073 #if wxUSE_UNICODE == 1
00074   #define wxJSON_USE_UNICODE
00075 #endif
00076 
00077 // the following macro, if defined, cause the wxJSONValue to store
00078 // pointers to C-strings as pointers to statically allocated
00079 // C-strings. By default this macro is not defined
00080 // #define wxJSON_USE_CSTRING
00081 
00082 
00083 // the following macro, if defined, cause the wxJSONvalue and its
00084 // referenced data structure to store and increment a static
00085 // progressive counter in the ctor.
00086 // this is only usefull for debugging purposes
00087 // #define WXJSON_USE_VALUE_COUNTER
00088 
00089 
00090 // the following macro is used by wxJSON internally and you should not
00091 // modify it. If the platform seems to support 64-bits integers,
00092 // the following lines define the 'wxJSON_64BIT_INT' macro
00093 #if defined( wxLongLong_t )
00094 #define wxJSON_64BIT_INT
00095 #endif
00096 
00097 
00098 //
00099 // the following macro, if defined, cause the wxJSON library to
00100 // always use 32-bits integers also when the platform seems to
00101 // have native 64-bits support: by default the macro if not defined
00102 //
00103 // #define wxJSON_NO_64BIT_INT
00104 //
00105 #if defined( wxJSON_NO_64BIT_INT ) && defined( wxJSON_64BIT_INT )
00106 #undef wxJSON_64BIT_INT
00107 #endif
00108 
00109 //
00110 // it seems that some compilers do not define 'long long int' limits
00111 // constants. For example, this is the output of the Borland BCC 5.5
00112 // compiler when I tried to compile wxJSON with 64-bits integer support:
00113 //   Error E2451 ..\src\jsonreader.cpp 1737: Undefined symbol 'LLONG_MAX'
00114 //   in function wxJSONReader::Strtoll(const wxString &,__int64 *)
00115 //   *** 1 errors in Compile ***
00116 // so, if the constants are not defined, I define them by myself
00117 #if !defined( LLONG_MAX )
00118   #define LLONG_MAX      9223372036854775807
00119 #endif
00120 
00121 #if !defined( ULLONG_MAX )
00122   #define ULLONG_MAX    18446744073709551615
00123 #endif
00124 
00125 #if !defined( LLONG_MIN )
00126   #define LLONG_MIN     -9223372036854775808    
00127 #endif
00128 
00129 
00130 
00131 // the same applies for all other integer constants
00132 #if !defined( INT_MIN )
00133   #define INT_MIN       -32768
00134 #endif
00135 #if !defined( INT_MAX )
00136   #define INT_MAX        32767
00137 #endif
00138 #if !defined( UINT_MAX )
00139   #define UINT_MAX       65535
00140 #endif
00141 #if !defined( LONG_MIN )
00142   #define LONG_MIN       -2.147.483.648
00143 #endif
00144 #if !defined( LONG_MAX )
00145   #define LONG_MAX       2.147.483.647
00146 #endif
00147 #if !defined( ULONG_MAX )
00148   #define ULONG_MAX       4.294.967.295
00149 #endif
00150 #if !defined( SHORT_MAX )
00151   #define SHORT_MAX     32767
00152 #endif
00153 #if !defined( SHORT_MIN )
00154   #define SHORT_MIN     -32768
00155 #endif
00156 #if !defined( USHORT_MAX )
00157   #define USHORT_MAX    65535
00158 #endif
00159 
00160 
00161 
00162 //
00163 // define the wxJSON_ASSERT() macro to expand to wxASSERT()
00164 // unless the wxJSON_NOABORT_ASSERT is defined
00165 #define wxJSON_NOABORT_ASSERT
00166 #if defined( wxJSON_NOABORT_ASSERT )
00167   #define wxJSON_ASSERT( cond ) 
00168 #else
00169   #define wxJSON_ASSERT( cond )         wxASSERT( cond );
00170 #endif
00171 
00172 
00173 //
00174 // the following macros are used by the wxJSONWriter::WriteStringValues()
00175 // when the wxJSONWRITER_SPLIT_STRING flag is set
00176 #define wxJSONWRITER_LAST_COL   50
00177 #define wxJSONWRITER_SPLIT_COL  75
00178 #define wxJSONWRITER_MIN_LENGTH 15
00179 #define wxJSONWRITER_TAB_LENGTH  4
00180 
00181 
00182 
00183 #endif // _WX_JSON_DEFS_H_
00184 
00185 

Generated on Mon Aug 18 22:54:22 2008 for wxJSON by  doxygen 1.4.7