X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=os.hpp;h=0716784ec939e0ef29ba7563b54a9f7166ef9d2c;hb=70feb6589c3e2f3b874051167c50858a522dd77b;hp=42a3daac7ce7cf09f80359c424530daded40f190;hpb=5caf870ab30803b921cb28b8009eb654e3ac2992;p=apitrace diff --git a/os.hpp b/os.hpp index 42a3daa..0716784 100644 --- a/os.hpp +++ b/os.hpp @@ -34,7 +34,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #ifndef snprintf #define snprintf _snprintf #endif @@ -42,9 +42,9 @@ #define vsnprintf _vsnprintf #endif #define PATH_SEP '\\' -#else /* !WIN32 */ +#else /* !_WIN32 */ #define PATH_SEP '/' -#endif /* !WIN32 */ +#endif /* !_WIN32 */ #ifndef PATH_MAX #define PATH_MAX 1024 @@ -61,6 +61,24 @@ bool GetCurrentDir(char *str, size_t size); void DebugMessage(const char *format, ...); +#if defined _WIN32 || defined __CYGWIN__ + /* We always use .def files on windows for now */ + #if 0 + #define PUBLIC __declspec(dllexport) + #else + #define PUBLIC + #endif + #define PRIVATE +#else + #if __GNUC__ >= 4 + #define PUBLIC __attribute__ ((visibility("default"))) + #define PRIVATE __attribute__ ((visibility("hidden"))) + #else + #define PUBLIC + #define PRIVATE + #endif +#endif + /** * Get the current time in microseconds from an unknown base. */