00001 #ifndef MARSYAS_COMMON_H
00002 #define MARSYAS_COMMON_H
00003
00009
00010
00011
00012 #include "config.h"
00013
00014 #include <cstdio>
00015 #include <sys/types.h>
00016 #include <complex>
00017 #include <limits>
00018 #include "MrsLog.h"
00019
00020
00021
00022
00023
00024 #ifdef WIN32
00025 #ifndef NOMINMAX
00026 #define NOMINMAX
00027 #endif
00028 #endif
00029
00030
00031
00032
00033
00034
00035
00036 #ifdef MARSYAS_LOG_DEBUGS
00037 #define MRSDEBUG(x) {std::ostringstream oss; MrsLog::mrsDebug((std::ostringstream&)(oss << x));}
00038 #else
00039 #define MRSDEBUG(x)
00040 #endif
00041
00042
00043
00044
00045
00046
00047
00048 #ifdef MARSYAS_MATLAB
00049 #include "MATLABengine.h"
00050 #define MATLAB_PUT(var, name) {MATLABengine::getMatlabEng()->putVariable(var, name);}
00051 #define MATLAB_GET(name, var) MATLABengine::getMatlabEng()->getVariable(name, var)
00052 #define MATLAB_EVAL(s) {std::ostringstream oss; MATLABengine::getMatlabEng()->evalString((std::ostringstream&)(oss << s));}
00053 #define MATLAB_CLOSE() MATLABengine::getMatlabEng()->closeMatlabEng()
00054 #else
00055 #define MATLAB_PUT(var, name) {}
00056 #define MATLAB_GET(name, var) {}
00057
00058 #define MATLAB_EVAL(s) {}
00059 #define MATLAB_CLOSE() {}
00060 #endif
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 #ifdef MARSYAS_WIN32 //|| defined (MARSYAS_MINGW)
00072 #include <windows.h>
00073 #define SLEEP(milliseconds) Sleep((DWORD) milliseconds)
00074 #else
00075 #include <unistd.h>
00076 #define SLEEP(milliseconds) usleep((unsigned long) (milliseconds) * 1000.0)
00077 #endif
00078
00079
00080
00081
00082
00083
00084
00085 #ifdef MARSYAS_WIN32
00086 #pragma warning(disable : 4996)
00087 #endif
00088
00089 #endif
00090