[flac-dev] os/2 support using Watcom
Dave Yeo
dave.r.yeo at gmail.com
Mon Jan 23 23:40:34 UTC 2017
On 01/23/17 01:01 AM, Erik de Castro Lopo wrote:
> Dave Yeo wrote:
>
>> >GCC supports __declspec(dllexport) though it still needs a def file,
>> >with no exports. Libtool doesn't currently and as flac uses libtool...
> So you're happy with this patch?
>
> http://lists.xiph.org/pipermail/flac-dev/2017-January/006170.html
>
No. Lots of errors such as
../../include/FLAC/export.h:77:18: error: expected identifier or '(' before ')' token
#define FLAC_API __declspec(__cdecl)
...
as GCC doesn't like the __cdecl macro.
If going this route then perhaps,
diff --git a/include/FLAC/export.h b/include/FLAC/export.h
index d52f0bb..5d40421 100644
--- a/include/FLAC/export.h
+++ b/include/FLAC/export.h
@@ -66,6 +66,13 @@
#define FLAC_API __declspec(dllimport)
#endif
+#elif defined(__OS2__)
+#if defined(FLAC_API_EXPORTS) && defined(__WATCOMC__) && defined(__SW_BD)
+#define FLAC_API __declspec(__cdecl) __declspec(dllexport)
+#else
+#define FLAC_API __declspec(dllexport)
+#endif
+
#elif defined(FLAC__USE_VISIBILITY_ATTR)
#define FLAC_API __attribute__ ((visibility ("default")))
Another option is for the caller to define FLAC_API, eg
#define FLAC_API __declspec(__cdecl)
#include <flac\all.h>
diff --git a/include/FLAC/export.h b/include/FLAC/export.h
index d52f0bb..07cfe59 100644
--- a/include/FLAC/export.h
+++ b/include/FLAC/export.h
@@ -56,6 +56,7 @@
* \{
*/
+#ifndef FLAC_API
#if defined(FLAC__NO_DLL)
#define FLAC_API
@@ -66,6 +67,10 @@
#define FLAC_API __declspec(dllimport)
#endif
+#elif defined(__OS2__)
+#define FLAC_API __declspec(dllexport)
+#endif
+
#elif defined(FLAC__USE_VISIBILITY_ATTR)
#define FLAC_API __attribute__ ((visibility ("default")))
@@ -73,7 +78,7 @@
#define FLAC_API
#endif
-
+#endif
/** These #defines will mirror the libtool-based library version number, see
* http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
*/
This assumes that Ozkan isn't pursuing his OpenWatcom patches which isn't clear. Either way callers should be able to define FLAC_API.
Dave
More information about the flac-dev
mailing list