config.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef SOFA_HELPER_SYSTEM_CONFIG_H
00028 #define SOFA_HELPER_SYSTEM_CONFIG_H
00029
00030 #ifdef WIN32
00031 #ifdef _MSC_VER
00032 #ifndef NOMINMAX
00033 #define NOMINMAX
00034 #endif
00035 #define snprintf _snprintf
00036 #endif
00037 #include <windows.h>
00038 #endif
00039
00040 #ifdef _MSC_VER
00041 # define _USE_MATH_DEFINES // required to get M_PI from math.h
00042
00043 typedef signed __int8 int8_t;
00044 typedef signed __int16 int16_t;
00045 typedef signed __int32 int32_t;
00046 typedef signed __int64 int64_t;
00047 typedef unsigned __int8 uint8_t;
00048 typedef unsigned __int16 uint16_t;
00049 typedef unsigned __int32 uint32_t;
00050 typedef unsigned __int64 uint64_t;
00051 #else
00052 #include <stdint.h>
00053 #endif
00054
00055 #ifdef SOFA_FLOAT
00056 typedef float SReal;
00057 #else
00058 typedef double SReal;
00059 #endif
00060
00061 #define sofa_concat(a,b) sofa_do_concat(a,b)
00062 #define sofa_do_concat(a,b) sofa_do_concat2(a,b)
00063 #define sofa_do_concat2(a,b) a##b
00064
00065 #define sofa_tostring(a) sofa_do_tostring(a)
00066 #define sofa_do_tostring(a) #a
00067
00068 #define SOFA_DECL_CLASS(name) extern "C" { int sofa_concat(class_,name) = 0; }
00069 #define SOFA_LINK_CLASS(name) extern "C" { extern int sofa_concat(class_,name); int sofa_concat(link_,name) = sofa_concat(class_,name); }
00070
00071 #endif