Further changes to msvc/pbd (mostly to add support for getopt and getopt_long)
[ardour.git] / libs / pbd / pbd / msvc_pbd.h
index c0c76e45df520c850c2975b2ed5170eaaad281ca..8d157731bdf4ff9fd184290d5c76040264f4cb00 100644 (file)
        // Other compilers / platforms could be accommodated here
        #define PBD_API
        #define PBD_APICALLTYPE
+       #define GETOPT_API
+       #define GETOPT_APICALLTYPE
 #endif
 
+#ifndef GETOPT_API
+       #if defined(BUILDING_GETOPT)
+               #define GETOPT_API __declspec(dllexport)
+               #define GETOPT_APICALLTYPE __cdecl
+       #elif defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW__) || defined(_MINGW32__)
+               #define GETOPT_API __declspec(dllimport)
+               #define GETOPT_APICALLTYPE __cdecl
+       #else
+               #error "Attempting to define __declspec with an incompatible compiler !"
+       #endif
+#endif  // GETOPT_API
+
 #ifndef _MAX_PATH
 #define _MAX_PATH  260
 #endif