]> git.cworth.org Git - apitrace/blobdiff - os.hpp
Don't (de)serialize mirror images.
[apitrace] / os.hpp
diff --git a/os.hpp b/os.hpp
index dbe8deb3ec4b3b45b51406880a0878fb37eb941a..8e487b502937f02c5e80ae0a292c9c7fd0e7d7d0 100644 (file)
--- a/os.hpp
+++ b/os.hpp
  *
  **************************************************************************/
 
+/*
+ * Simple OS abstraction layer.
+ */
+
 #ifndef _OS_HPP_
 #define _OS_HPP_
 
 #include <stdlib.h>
 #include <stdarg.h>
+#include <stdio.h>
 
-#ifdef WIN32
+#ifdef _WIN32
 #ifndef snprintf
 #define snprintf _snprintf
 #endif
@@ -37,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
@@ -54,7 +59,29 @@ void ReleaseMutex(void);
 bool GetProcessName(char *str, size_t size);
 bool GetCurrentDir(char *str, size_t size);
 
-void DebugMessage(const char *format, ...);
+void DebugMessage(const char *format, ...)
+#ifdef __GNUC__
+    __attribute__ ((format (printf, 1, 2)))
+#endif
+;
+
+#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.
@@ -63,6 +90,9 @@ long long GetTime(void);
 
 void Abort(void);
 
+void SetExceptionCallback(void (*callback)(void));
+void ResetExceptionCallback(void);
+
 } /* namespace OS */
 
 #endif /* _OS_HPP_ */