29 #define STRINGIFY(PARAM) STRINGIFY_INTERNAL(PARAM)
30 #define STRINGIFY_INTERNAL(PARAM) #PARAM
33 #if !defined(_MSC_VER)
34 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
35 # define TYPEOF decltype
37 # define TYPEOF typeof
43 #pragma warning(disable: 4251) //member is not dllexport
44 #pragma warning(disable: 4267) //conversion from 'size_t' to 'type', possible loss of data
45 #pragma warning(disable: 4275) //base class is not dllexport
46 #pragma warning(disable: 4244) //conversion to (or from) smaller integer type
47 #pragma warning(disable: 4355) //'this' pointer used in initializer list
48 #pragma warning(disable: 4800) //non-bool value coerced into bool (e.g. bool a = 5;)
49 #pragma warning(disable: 4503) //decorated name too long, truncated
50 #pragma warning(disable: 4344) //template specialisation results in different function being called (getProperty<>)
54 #if defined(DLL_TULIP) || defined(DLL_TULIP_GL) || defined(DLL_TULIP_QT) || defined(DLL_TULIP_QT2)
55 #pragma warning(disable: 4996) //deprecated functions
60 # define _DEPRECATED __declspec(deprecated)
61 # define _DEPRECATED_TYPEDEF(type, deprecated_type) typedef _DEPRECATED type deprecated_type
62 # define TYPEOF decltype
65 # include "boost/typeof/typeof.hpp"
66 # define TYPEOF BOOST_TYPEOF
69 # define __PRETTY_FUNCTION__ __FUNCTION__ //MSVC has a different name for pretty_function
70 # define strcasecmp stricmp //strcasecmp does not exists for VC, workaround
74 static double fabs(
int i) {
75 return std::fabs(static_cast<double>(i));
78 # if _MSC_VER < 1800 // Visual Studio 2013 improved C99 support, no need to redefine some cmath functions
83 static double sqrt(
int i) {
84 return std::sqrt(static_cast<double>(i));
87 static double sqrt(
unsigned int i) {
88 return std::sqrt(static_cast<double>(i));
91 static double log(
int i) {
92 return std::log(static_cast<double>(i));
95 static double log(
unsigned int i) {
96 return std::log(static_cast<double>(i));
99 static double floor(
int i) {
100 return std::floor(static_cast<double>(i));
103 static double floor(
unsigned int i) {
104 return std::floor(static_cast<double>(i));
107 static double round(
double d) {
108 return std::floor(d + 0.5);
111 static float strtof(
const char* cptr,
char** endptr) {
112 return std::strtod(cptr, endptr);
115 #define isnan(x) ((x) != (x)) //you guessed it, this is a C99 feature, and VC++ does not support C99. workaroud this.
116 #define rint(arg) arg > 0 ? static_cast<int>(std::floor(static_cast<double>(arg))) : static_cast<int>(std::ceil(static_cast<double>(arg))) //Hey, nother C99 feature !
118 # else // _MSC_VER < 1800
123 # endif // _MSC_VER < 1800
127 # define _DEPRECATED __attribute__ ((deprecated))
128 # define _DEPRECATED_TYPEDEF(type, deprecated_type) typedef type deprecated_type _DEPRECATED
129 # define stdext __gnu_cxx
132 #if __clang_major__ >= 3 && __clang_minor__ >= 4
133 #pragma clang diagnostic ignored "-Wdeprecated-register"
135 #if __clang_major__ >= 3 && __clang_minor__ >= 5
136 #pragma clang diagnostic ignored "-Wtautological-undefined-compare"
141 # define _DEPRECATED __attribute__ ((deprecated))
142 # define _DEPRECATED_TYPEDEF(type, deprecated_type) typedef type deprecated_type _DEPRECATED
143 # define stdext __gnu_cxx
144 # if (__GNUC_MINOR__ < 4 && __GNUC__ < 4)
145 # include <ext/stl_hash_fun.h>
146 # elif (__GNUC_MINOR__ < 3 && __GNUC__ <= 4)
147 # include <ext/hash_fun.h>
148 # elif (__GNUC_MINOR__ > 3 && __GNUC__ >= 4)
149 # include <backward/hash_fun.h>
156 # define TLP_SCOPE __declspec(dllexport)
158 # define TLP_SCOPE __declspec(dllimport)
167 # define TLP_GL_SCOPE __declspec(dllexport)
169 # define TLP_GL_SCOPE __declspec(dllimport)
173 # define TLP_GL_SCOPE
178 # define TLP_QT_SCOPE __declspec(dllexport)
180 # define TLP_QT_SCOPE __declspec(dllimport)
184 # define TLP_QT_SCOPE
188 # ifdef DLL_TULIP_PYTHON
189 # define TLP_PYTHON_SCOPE __declspec(dllexport)
191 # define TLP_PYTHON_SCOPE __declspec(dllimport)
194 #ifndef TLP_PYTHON_SCOPE
195 # define TLP_PYTHON_SCOPE
199 # ifdef DLL_TULIP_OGDF
200 # define TLP_OGDF_SCOPE __declspec(dllexport)
202 # define TLP_OGDF_SCOPE __declspec(dllimport)
205 #ifndef TLP_OGDF_SCOPE
206 # define TLP_OGDF_SCOPE
216 extern TLP_SCOPE std::ostream& debug();
221 extern TLP_SCOPE
void setDebugOutput(std::ostream& os);
226 extern TLP_SCOPE std::ostream& warning();
231 extern TLP_SCOPE
void setWarningOutput(std::ostream& os);
236 extern TLP_SCOPE std::ostream& error();
241 extern TLP_SCOPE
void setErrorOutput(std::ostream& os);