Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016
00017
00019
00020
00021
00023
00024
00025 #if !defined(OPENNURBS_SYSTEM_INC_)
00026 #define OPENNURBS_SYSTEM_INC_
00027
00028
00029
00030
00031 #define OPENNURBS_PUBLIC_RELEASE
00032
00033
00034 #if defined(_MSC_VER)
00035
00036 #if defined(OPENNURBS_EXPORTS)
00037
00038
00039 #if !defined(ON_DLL_EXPORTS)
00040 #define ON_DLL_EXPORTS
00041 #endif
00042 #if !defined(ON_COMPILING_OPENNURBS)
00043 #define ON_COMPILING_OPENNURBS
00044 #endif
00045 #endif
00046
00047 #if defined(OPENNURBS_IMPORTS)
00048
00049
00050 #if !defined(ON_DLL_IMPORTS)
00051 #define ON_DLL_IMPORTS
00052 #endif
00053 #endif
00054
00055
00056 #define ON_COMPILER_MSC
00057
00058 #if _MSC_VER >= 1300
00059 #define ON_COMPILER_MSC1300
00060
00061
00062
00063
00064
00065 #if _MSC_VER >= 1400
00066
00067 #define ON_COMPILER_MSC1400
00068
00069
00070 #if _MSC_VER >= 1600
00071
00072 #define ON_COMPILER_MSC1600
00073 #endif
00074
00075
00076
00077
00078
00079
00080
00081 #if defined(ON_COMPILING_OPENNURBS)
00082 #pragma warning(disable:4100) // C4100: 'identifier' : unreferenced formal parameter
00083 #endif
00084
00085 #if !defined(_CRT_SECURE_NO_DEPRECATE)
00086 #define _CRT_SECURE_NO_DEPRECATE
00087
00088
00089
00090
00091
00092 #endif
00093
00094 #endif
00095
00096 #endif
00097
00098 #endif
00099
00100 #if defined(__GNUG_) || defined(__GNUG__) || defined(__GNUC_) || defined(__GNUC__) || defined(_GNU_SOURCE) || defined(__GNU_SOURCE)
00101
00102 #if !defined(ON_COMPILER_GNU)
00103 #define ON_COMPILER_GNU
00104 #endif
00105 #if !defined(_GNU_SOURCE)
00106 #define _GNU_SOURCE
00107 #endif
00108 #endif
00109
00110
00111 #if defined(_GNU_SOURCE) && defined(__APPLE__)
00112
00113 #if !defined(ON_COMPILER_XCODE)
00114 #define ON_COMPILER_XCODE
00115 #endif
00116 #endif
00117
00118 #if defined(__BORLANDC__)
00119
00120 #define ON_COMPILER_BORLAND
00121 #endif
00122
00123
00124
00125
00126
00127
00128 #if !defined(ON_NO_WINDOWS)
00129
00130
00132
00133
00134
00135 #if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64)
00136
00137 #if defined(_M_X64) && defined(WIN32) && defined(WIN64)
00138
00139
00140 #if defined(_INC_WINDOWS)
00141
00142
00143
00144
00145 #undef WIN32
00146 #else
00147 #error do not define WIN32 for x64 builds
00148 #endif
00149
00150
00151 #endif
00152
00153
00154
00155
00156
00157
00158
00159
00160 #if defined(ON_COMPILER_MSC1600)
00161
00162
00163
00164
00165
00166 #endif
00167
00168 #if !defined(_WINDOWS_)
00169
00170 #define WIN32_LEAN_AND_MEAN
00171 #include <windows.h>
00172 #endif
00173
00174 #if defined(_M_X64) && defined(WIN32) && defined(WIN64)
00175
00176
00177
00178 #undef WIN32
00179 #endif
00180
00181
00182
00183
00184
00185
00186
00187 #if !defined(ON_OS_WINDOWS)
00188 #define ON_OS_WINDOWS
00189 #endif
00190
00191 #if defined(ON_OS_WINDOWS) && !defined(NOGDI)
00192
00193 #define ON_OS_WINDOWS_GDI
00194 #endif
00195
00196 #if defined(_MSC_VER)
00197
00198
00199
00200
00201
00202
00203 #define ON_MSC_CDECL __cdecl
00204
00205 #endif
00206
00207 #endif
00208
00209 #endif
00210
00211
00212
00213
00217
00218
00219
00220 #include <stdlib.h>
00221 #include <memory.h>
00222 #if defined(ON_COMPILER_XCODE)
00223 #include <malloc/malloc.h>
00224 #else
00225 #include <malloc.h>
00226 #endif
00227 #include <string.h>
00228 #include <math.h>
00229 #include <stdio.h>
00230 #include <stdarg.h>
00231 #include <float.h>
00232 #include <time.h>
00233 #include <limits.h>
00234 #include <ctype.h>
00235
00236 #if defined(ON_COMPILER_IRIX)
00237 #include <alloca.h>
00238 #endif
00239
00240 #if !defined(ON_COMPILER_BORLAND)
00241 #include <wchar.h>
00242 #endif
00243
00244 #if defined(ON_OS_WINDOWS)
00245 #include <io.h>
00246 #include <sys/stat.h>
00247 #include <tchar.h>
00248
00249
00250
00251 #include <Rpc.h>
00252
00253 #endif
00254
00255 #if defined(ON_COMPILER_GNU)
00256 #include <sys/types.h>
00257 #include <sys/stat.h>
00258 #include <wctype.h>
00259 #include <dirent.h>
00260 #if defined(ON_COMPILER_XCODE)
00261 #include <uuid/uuid.h>
00262 #endif
00263 #endif
00264
00265 #include <errno.h>
00266
00267 #if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus)
00268
00269
00270 #if !defined(ON_CPLUSPLUS)
00271 #define ON_CPLUSPLUS
00272 #endif
00273
00274 #include <new>
00275
00276 #endif
00277
00278 #if !defined(ON_MSC_CDECL)
00279 #define ON_MSC_CDECL
00280 #endif
00281
00282 #if !defined(ON_OS_WINDOWS) && !defined(_GNU_SOURCE) && !defined(ON_COMPILER_XCODE)
00283
00284
00285
00286 #if !defined(true)
00287 #define true true
00288 #endif
00289
00290 #if !defined(false)
00291 #define false false
00292 #endif
00293
00294 #if !defined(NULL)
00295 #define NULL 0
00296 #endif
00297
00298 #if !defined(_WCHAR_T_DEFINED)
00299
00300
00301
00302
00303
00304
00305
00306 #if !defined(_WCHAR_T)
00307 typedef unsigned short wchar_t;
00308 #endif
00309
00310 #define _WCHAR_T_DEFINED
00311 #endif
00312
00313 #endif
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325 #if defined(_M_X64) || defined(_WIN64) || defined(__LP64__)
00326
00327 #define ON_SIZEOF_POINTER 8
00328 #define ON_64BIT_POINTER
00329
00330 #define ON_MAX_SIZE_T 0xFFFFFFFFFFFFFFFF
00331 #else
00332
00333 #define ON_SIZEOF_POINTER 4
00334 #define ON_32BIT_POINTER
00335
00336 #define ON_MAX_SIZE_T 0xFFFFFFFF
00337 #endif
00338
00339
00340 typedef char ON__INT8;
00341
00342
00343 typedef unsigned char ON__UINT8;
00344
00345
00346 typedef short ON__INT16;
00347
00348
00349 typedef unsigned short ON__UINT16;
00350
00351
00352 typedef int ON__INT32;
00353
00354
00355 typedef unsigned int ON__UINT32;
00356
00357 #if defined(ON_COMPILER_MSC)
00358
00359
00360
00361
00362 typedef __int64 ON__INT64;
00363
00364
00365 typedef unsigned __int64 ON__UINT64;
00366
00367 #elif defined(ON_COMPILER_GNU)
00368
00369
00370
00371
00372 typedef long long ON__INT64;
00373
00374
00375 typedef unsigned long long ON__UINT64;
00376
00377 #else
00378
00379 #error Verify that long long is a 64 bit integer with your compiler!
00380
00381
00382 typedef long long ON__INT64;
00383
00384
00385 typedef unsigned long long ON__UINT64;
00386
00387 #endif
00388
00389
00390
00391 typedef int ON_BOOL32;
00392
00393
00394 #if 8 == ON_SIZEOF_POINTER
00395
00396 #if defined(ON_COMPILER_GNU)
00397 typedef long long ON__INT_PTR;
00398 typedef unsigned long long ON__UINT_PTR;
00399 #else
00400 typedef __int64 ON__INT_PTR;
00401 typedef unsigned __int64 ON__UINT_PTR;
00402 #endif
00403
00404 #elif 4 == ON_SIZEOF_POINTER
00405
00406 typedef int ON__INT_PTR;
00407 typedef unsigned int ON__UINT_PTR;
00408
00409 #else
00410 #error Update OpenNURBS to work with new pointer size.
00411 #endif
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431 #if defined(ON_OS_WINDOWS) && defined(ON_COMPILER_MSC)
00432
00433 #if defined(_M_X64) || defined(_M_IX86)
00434 #if !defined(ON_LITTLE_ENDIAN)
00435 #define ON_LITTLE_ENDIAN
00436 #endif
00437 #endif
00438
00439 #endif
00440
00441 #if defined(ON_COMPILER_XCODE)
00442
00443
00444 #if (defined(__ppc__) || defined(__ppc64__))
00445 #define ON_BIG_ENDIAN
00446 #elif (defined (__i386__) || defined( __x86_64__ ))
00447 #define ON_LITTLE_ENDIAN
00448 #endif
00449
00450 #endif
00451
00452
00453 #if defined(ON_LITTLE_ENDIAN) && defined(ON_BIG_ENDIAN)
00454 #error At most one of ON_LITTLE_ENDIAN and ON_BIG_ENDIAN can be defined.
00455 #endif
00456
00457
00458
00459
00460
00461 int on_vsnprintf( char *buffer, size_t count, const char *format, va_list argptr );
00462
00463 int on_vsnwprintf( wchar_t *buffer, size_t count, const wchar_t *format, va_list argptr );
00464
00465
00466 #endif
00467