comparison Core/SystemToolbox.cpp @ 2364:ae50eccd41b7

compilation succeeds on OpenBSD
author jodogne
date Mon, 21 Aug 2017 16:28:53 +0200
parents 9ccd7f926c5b
children 9e0eae8a5ea4
comparison
equal deleted inserted replaced
2363:f8ef157f2d73 2364:ae50eccd41b7
65 // Inclusions for UUID 65 // Inclusions for UUID
66 // http://stackoverflow.com/a/1626302 66 // http://stackoverflow.com/a/1626302
67 67
68 extern "C" 68 extern "C"
69 { 69 {
70 #ifdef WIN32 70 #if defined(_WIN32)
71 # include <rpc.h> 71 # include <rpc.h>
72 #else 72 #else
73 # include <uuid/uuid.h> 73 # include <uuid/uuid.h>
74 #endif 74 #endif
75 } 75 }
155 155
156 void SystemToolbox::USleep(uint64_t microSeconds) 156 void SystemToolbox::USleep(uint64_t microSeconds)
157 { 157 {
158 #if defined(_WIN32) 158 #if defined(_WIN32)
159 ::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000))); 159 ::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000)));
160 #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) || defined(__native_client__) 160 #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__native_client__)
161 usleep(microSeconds); 161 usleep(microSeconds);
162 #else 162 #else
163 #error Support your platform here 163 #error Support your platform here
164 #endif 164 #endif
165 } 165 }
368 _NSGetExecutablePath( pathbuf, &bufsize); 368 _NSGetExecutablePath( pathbuf, &bufsize);
369 369
370 return std::string(pathbuf); 370 return std::string(pathbuf);
371 } 371 }
372 372
373 #elif defined(__OpenBSD__)
374 static std::string GetPathToExecutableInternal()
375 {
376 // TODO
377 throw OrthancException(ErrorCode_NotImplemented);
378 }
379
373 #else 380 #else
374 #error Support your platform here 381 #error Support your platform here
375 #endif 382 #endif
376 383
377 384