29 #define STRINGIFY(PARAM) STRINGIFY_INTERNAL(PARAM)
30 #define STRINGIFY_INTERNAL(PARAM) #PARAM
33 #if !defined(_MSC_VER)
34 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
35 # define TYPEOF decltype
37 # define TYPEOF typeof
43 #pragma warning(disable: 4251) //member is not dllexport
44 #pragma warning(disable: 4275) //base class is not dllexport
45 #pragma warning(disable: 4244) //conversion to (or from) smaller integer type
46 #pragma warning(disable: 4355) //'this' pointer used in initializer list
47 #pragma warning(disable: 4800) //non-bool value coerced into bool (e.g. bool a = 5;)
48 #pragma warning(disable: 4503) //decorated name too long, truncated
49 #pragma warning(disable: 4344) //template specialisation results in different function being called (getProperty<>)
52 #if defined(DLL_TULIP) || defined(DLL_TULIP_GL) || defined(DLL_TULIP_QT) || defined(DLL_TULIP_QT2)
53 #pragma warning(disable: 4996) //deprecated functions
57 # define _DEPRECATED __declspec(deprecated)
58 # define _DEPRECATED_TYPEDEF(type, deprecated_type) typedef _DEPRECATED type deprecated_type
59 # define TYPEOF decltype
62 # include "boost/typeof/typeof.hpp"
63 # define TYPEOF BOOST_TYPEOF
69 static double sqrt(
int i) {
70 return sqrt((
double)i);
72 static double sqrt(
unsigned int i) {
73 return sqrt((
double)i);
76 static double log(
int i) {
77 return log((
double)i);
79 static double log(
unsigned int i) {
80 return log((
double)i);
83 static double floor(
int i) {
84 return floor((
double)i);
86 static double floor(
unsigned int i) {
87 return floor((
double)i);
90 static double round(
double d) {
91 return floor(d + 0.5);
94 static double fabs(
int i) {
95 return fabs((
double)i);
98 static float strtof(
const char* cptr,
char** endptr) {
99 return strtod(cptr, endptr);
102 # define __PRETTY_FUNCTION__ __FUNCTION__ //MSVC has a different name for pretty_function
103 # define strcasecmp stricmp //strcasecmp does not exists for VC, workaround
104 # define isnan(x) ((x) != (x)) //you guessed it, this is a C99 feature, and VC++ does not support C99. workaroud this.
105 # define rint(arg) arg > 0 ? (int)std::floor((double)arg) : (int)std::ceil((double)arg) //Hey, nother C99 feature !
109 # define _DEPRECATED __attribute__ ((deprecated))
110 # define _DEPRECATED_TYPEDEF(type, deprecated_type) typedef type deprecated_type _DEPRECATED
111 # define stdext __gnu_cxx
115 # define _DEPRECATED __attribute__ ((deprecated))
116 # define _DEPRECATED_TYPEDEF(type, deprecated_type) typedef type deprecated_type _DEPRECATED
117 # define stdext __gnu_cxx
118 # if (__GNUC_MINOR__ < 4 && __GNUC__ < 4)
119 # include <ext/stl_hash_fun.h>
120 # elif (__GNUC_MINOR__ < 3)
121 # include <ext/hash_fun.h>
128 # define TLP_SCOPE __declspec(dllexport)
130 # define TLP_SCOPE __declspec(dllimport)
139 # define TLP_GL_SCOPE __declspec(dllexport)
141 # define TLP_GL_SCOPE __declspec(dllimport)
145 # define TLP_GL_SCOPE
150 # define TLP_QT_SCOPE __declspec(dllexport)
152 # define TLP_QT_SCOPE __declspec(dllimport)
156 # define TLP_QT_SCOPE
160 # ifdef DLL_TULIP_PYTHON
161 # define TLP_PYTHON_SCOPE __declspec(dllexport)
163 # define TLP_PYTHON_SCOPE __declspec(dllimport)
166 #ifndef TLP_PYTHON_SCOPE
167 # define TLP_PYTHON_SCOPE
171 # ifdef DLL_TULIP_OGDF
172 # define TLP_OGDF_SCOPE __declspec(dllexport)
174 # define TLP_OGDF_SCOPE __declspec(dllimport)
177 #ifndef TLP_OGDF_SCOPE
178 # define TLP_OGDF_SCOPE
188 extern TLP_SCOPE std::ostream& debug();
193 extern TLP_SCOPE
void setDebugOutput(std::ostream& os);
198 extern TLP_SCOPE std::ostream& warning();
203 extern TLP_SCOPE
void setWarningOutput(std::ostream& os);
208 extern TLP_SCOPE std::ostream& error();
213 extern TLP_SCOPE
void setErrorOutput(std::ostream& os);