31 #ifndef CONFIGCOSMOS_H 32 #define CONFIGCOSMOS_H 49 #define COSMOS_WIN_BUILD_MSVC 53 #define NTDDI_VERSION NTDDI_WIN7 56 #define _WIN32_WINNT _WIN32_WINNT_WIN7 58 #define _WIN32_WINNT _WIN32_WINNT_WIN7 59 #endif // Building under Windows 62 #define _CRT_SECURE_NO_DEPRECATE 65 #define _USE_MATH_DEFINES 87 using std::stringstream;
91 using std::setprecision;
95 #ifdef COSMOS_WIN_BUILD_MSVC 114 using std::unique_lock;
117 #include <condition_variable> 118 using std::condition_variable;
122 using std::istringstream;
130 namespace Cosmos {
namespace Support {} }
139 #define COSMOS_SIZEOF(element) (reinterpret_cast<ptrdiff_t>(((element*)0)+1)) 150 #define COSMOS_LINUX_OS 153 #define COSMOS_USLEEP(usec) usleep(static_cast<uint32_t>(usec)) 154 #define COSMOS_SLEEP(sec) usleep(static_cast<uint32_t>((sec>=0.?sec:0)*1e6)) // this allows decimal seconds 155 #define CLOSE_SOCKET(socket) ::close(socket) 156 #define COSMOS_MKDIR(dtemp, mode) mkdir(const_cast<char *>(dtemp), mode) 157 #include <sys/socket.h> 159 #include <netinet/in.h> 161 #include <arpa/inet.h> 162 #include <sys/select.h> 163 #include <sys/stat.h> 164 #include <sys/types.h> 166 #include <sys/ioctl.h> 167 #include <sys/time.h> 175 #ifdef COSMOS_WIN_OS // Defined for both 32-bit and 64-bit environments 1 177 #include <winsock2.h> 181 #ifdef COSMOS_WIN_BUILD_MSVC 183 #define COSMOS_MKDIR(dtemp, mode) _mkdir((char *)dtemp) 185 #define COSMOS_MKDIR(dtemp, mode) mkdir((char *)dtemp) 188 #define COSMOS_USLEEP(usec) Sleep((uint32_t)(usec/1000. + .5)) 189 #define COSMOS_SLEEP(sec) Sleep((uint32_t)((sec>=0.?sec:0)*1000)) 190 #define CLOSE_SOCKET(socket) closesocket(socket) 193 #include <ws2tcpip.h> 195 #include <iphlpapi.h> 197 #include <mmsystem.h> 202 #include <sys/time.h> 214 #define COSMOS_MAC_OS 215 #define COSMOS_USLEEP(usec) usleep((uint32_t)usec) 219 #define COSMOS_SLEEP(sec) usleep((uint32_t)((sec>=0.?sec:0)*1e6)) 220 #define CLOSE_SOCKET(socket) ::close(socket) 221 #define COSMOS_MKDIR(dtemp, mode) mkdir((char *)dtemp, mode) 222 #include <sys/socket.h> 224 #include <netinet/in.h> 226 #include <arpa/inet.h> 227 #include <sys/select.h> 228 #include <sys/types.h> 229 #include <sys/time.h> 230 #include <sys/param.h> 231 #include <sys/mount.h> 236 #define COSMOS_CYGWIN_OS 237 #define COSMOS_USLEEP(usec) usleep((uint32_t)usec) 240 #define COSMOS_SLEEP(sec) sleep((uint32_t)(sec>=0.?sec:0)) 241 #define CLOSE_SOCKET(socket) close(socket) 242 #define COSMOS_MKDIR(dtemp, mode) mkdir((char *)dtemp,mode) 243 #include <sys/socket.h> 245 #include <netinet/in.h> 247 #include <arpa/inet.h> 248 #include <sys/select.h> 249 #include <sys/types.h> 250 #include <sys/time.h> 252 #endif // COSMOS_CYGWIN_OS 257 #endif // CONFIGCOSMOS_H
Definition: agentclass.cpp:54
string to_string(char *value)
Definition: stringlib.cpp:220
COSMOS definitions Definitions specific to the COSMOS environement.
Definition: agentclass.cpp:56