graphitemaster / incbin

Include binary files in C/C++
The Unlicense
941 stars 90 forks source link

Fixed issue with __attribute__((aligned(#))) not being available on MSVC #11

Closed IngwiePhoenix closed 9 years ago

IngwiePhoenix commented 9 years ago

Very tiny change. Therefore just a diff. :)

Ingwie@Ingwies-Macbook-Pro.local ~/W/I/incbin $ git diff
diff --git a/incbin.h b/incbin.h
index e8cb45a..709e4e0 100644
--- a/incbin.h
+++ b/incbin.h
@@ -22,7 +22,11 @@
 # endif
 #endif

+#ifndef _MSC_VER
 #define INCBIN_ALIGN __attribute__((aligned(INCBIN_ALIGNMENT)))
+#else
+#define INCBIN_ALIGN __declspec(align(INCBIN_ALIGNMENT))
+#endif

 #ifdef __cplusplus
 #  define INCBIN_EXTERNAL extern "C"

Sorry for the flood of messages, by the way. o.o

graphitemaster commented 9 years ago

Fixed