base: add few macros
authorMarko Kreen <markokr@gmail.com>
Wed, 9 Sep 2009 19:08:10 +0000 (22:08 +0300)
committerMarko Kreen <markokr@gmail.com>
Wed, 9 Sep 2009 19:08:10 +0000 (22:08 +0300)
STR - usual CPP stringifing

DLLEXPORT,DLLIMPORT for dlls on win32

usual/base.h

index 96d21f89d6e3af22dfcac957c55069506b3459fd..0c35df39a4cab33be81aeea180afdf72877cc9ec 100644 (file)
 
 #ifdef WIN32
 #include <usual/base_win32.h>
+#define DLLEXPORT __declspec(dllexport)
+#define DLLIMPORT __declspec(dllimport)
+#else
+#define DLLEXPORT
+#define DLLIMPORT
 #endif
 
 /* give offset of a field inside struct */
@@ -119,5 +124,9 @@ static inline void *zmalloc(size_t len)
        return calloc(1, len);
 }
 
+/* cpp expr -> string */
+#define _STR_(identifier) #identifier
+#define STR(x) _STR_(x)
+
 #endif