Skip to content

Instantly share code, notes, and snippets.

@PilzAdam
Created January 22, 2013 19:46
Show Gist options
  • Save PilzAdam/4597790 to your computer and use it in GitHub Desktop.
Save PilzAdam/4597790 to your computer and use it in GitHub Desktop.
diff --git a/src/porting.h b/src/porting.h
index 184e1ab..15e7629 100644
--- a/src/porting.h
+++ b/src/porting.h
@@ -39,7 +39,7 @@
//template<typename T> struct alignment_trick { char c; T member; };
//#define ALIGNOF(type) offsetof (alignment_trick<type>, member)
-#ifdef _WIN32
+#ifdef _MSC_VER
#include <windows.h>
#define ALIGNOF(x) __alignof(x)
@@ -56,6 +56,10 @@
#define sleep_ms(x) usleep(x*1000)
#endif
+#if defined(_WIN32) && defined(__GNUC__)
+ #define strtok_r(s,d,p) strtok(s,d)
+#endif
+
#define PADDING(x, y) ((ALIGNOF(y) - ((uintptr_t)(x) & (ALIGNOF(y) - 1))) & (ALIGNOF(y) - 1))
namespace porting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment