[flac-dev] os/2 support using Watcom
Ozkan Sezer
sezeroz at gmail.com
Sun Jan 22 17:57:00 UTC 2017
On 1/22/17, Dave Yeo <dave.r.yeo at gmail.com> wrote:
> On 01/22/17 05:35 AM, Ozkan Sezer wrote:
>> The attached set of patches adds support for OS/2 using Watcom compiler
>> (tested with Open Watcom 1.9). My only interest was building a working
>> dll (the last patch in the set adds a makefile for it), therefore I did
>> not touch other places: If there is interest, I can do so.
>
Disclaimer: I don't know much about EMX. That aside,
> Most of the patches can have s/__EMX__/__OS2__/
I intentionally kept __EMX__ checks because, IIRC, old gcc versions
(2.8?? can't remember) did define __EMX__ but not __OS2__
> excepting the nasm.h one.
> nasm.h should test for OBJ_FORMAT_obj as obj is also correct when
> building with GCC flags -Zomf.
OK, that can easily be added to configury, but..
> Not sure about the assembly prefix as
> generally cdecl is correct for OS/2, perhaps test for defined
> (__WATCOMC__) && defined (__OS2__)
Yeah: Default calling convention for Watcom is not __cdecl
it is, IIRC, __watcall and it doesn't prepend underscore to the
symbols
>
> Will the GCC built flac8.dll link with Watcom with something like
> diff --git a/include/FLAC/export.h b/include/FLAC/export.h
> index d52f0bb..96d5422 100644
> --- a/include/FLAC/export.h
> +++ b/include/FLAC/export.h
> @@ -69,6 +69,9 @@
> #elif defined(FLAC__USE_VISIBILITY_ATTR)
> #define FLAC_API __attribute__ ((visibility ("default")))
>
> +#elif defined (__WATCOMC__) && defined (__OS2__)
> +#define FLAC_API __declspec(__cdecl)
> +
> #else
> #define FLAC_API
As I said, I don't know much about emx, but the wrong thing
about the above is that it doesn't use dllexport therefore nothing
will be exported with this.
>
> Not sure if a OMF import lib is required but easy enough to create with
> implib or emximp
> Dave
Don't know about this either. [The reason I choose Watcom over
emx/gcc is that I can compile on linux using Watcom, however the
emx stuff still aren't ported to linux making cross-compiling is not
possible and that's a big no for me.]
--
O.S.
More information about the flac-dev
mailing list