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. Regards. -- O.S. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-exports.h-properly-define-FLAC_API-when-building-a-d.patch Type: application/octet-stream Size: 761 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170122/b0ecf40a/attachment.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-share-compat.h-properly-define-fseeko-ftello-and-FLA.patch Type: application/octet-stream Size: 695 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170122/b0ecf40a/attachment-0001.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-share-compat.h-add-__OS2__-to-list-of-cpp-checks-for.patch Type: application/octet-stream Size: 846 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170122/b0ecf40a/attachment-0002.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-metadata_iterators.c-add-__OS2__-to-the-list-of-cpp-.patch Type: application/octet-stream Size: 1641 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170122/b0ecf40a/attachment-0003.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-bitreader.c-bitwriter.c-solve-the-inline-issue-for-W.patch Type: application/octet-stream Size: 5823 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170122/b0ecf40a/attachment-0004.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0006-bitmath.h-provide-a-FLAC__clz_uint32-inline-asm-solu.patch Type: application/octet-stream Size: 1291 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170122/b0ecf40a/attachment-0005.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0007-lpc.c-provide-a-solution-for-missing-lround-for-Watc.patch Type: application/octet-stream Size: 1018 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170122/b0ecf40a/attachment-0006.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0008-ia32-nasm.h-for-Watcom-OS-2-asm-files-should-be-buil.patch Type: application/octet-stream Size: 1290 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170122/b0ecf40a/attachment-0007.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0009-add-a-Watcom-makefile-to-build-an-OS-2-dll.patch Type: application/octet-stream Size: 2603 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170122/b0ecf40a/attachment-0008.obj>
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.Most of the patches can have s/__EMX__/__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. Not sure about the assembly prefix as generally cdecl is correct for OS/2, perhaps test for defined (__WATCOMC__) && defined (__OS2__) 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 Not sure if a OMF import lib is required but easy enough to create with implib or emximp Dave
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_APIAs 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 > DaveDon'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.
Ozkan Sezer <sezeroz at gmail.com> 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.Patches that remove warnings of DJGPP compiler broke support for Visual Studio 2005/2008. I don't care about these versions really, but I find it very amusing that 20-years old and almost forgotten platforms are more important than 10-years old.
On 1/22/17, lvqcl <lvqcl.mail at gmail.com> wrote:> Ozkan Sezer <sezeroz at gmail.com> 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. > > Patches that remove warnings of DJGPP compiler broke support > for Visual Studio 2005/2008.those patches weren't from me (for the record)> I don't care about these versions really, but I find it very > amusing that 20-years old and almost forgotten platforms > are more important than 10-years old.if you noticed something in these patches that breaks some other platform and/or compiler, please tell.
On 01/22/17 10:55 AM, lvqcl wrote:> Ozkan Sezer <sezeroz at gmail.com> 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. > > Patches that remove warnings of DJGPP compiler broke support > for Visual Studio 2005/2008. > I don't care about these versions really, but I find it very > amusing that 20-years old and almost forgotten platforms > are more important than 10-years old. > _______________________________________________I'll note that the next release of (OEM branded) OS/2 is due on Mar 31st. So still not dead. https://www.arcanoae.com/ Dave
On 1/22/17, Dave Yeo <dave.r.yeo at gmail.com> wrote:> On 01/22/17 09:57 AM, Ozkan Sezer wrote: >> 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__ > > Flac won't compile with old EMX, if only due to the lack of the stdint > types. Pretty sure it's missing other math stuff as well.I see (but keeping the EMX checks won't hurt either)> >> >>> 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.. > > Please.Will cook something for it,> >> >>> 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 > > Yes, why it should only be used by Watcom. > >> >>> >>> 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. > > It should work with an import library (untested), namely adding flac.lib > to the linker directive for whatever is using flac8.dll. > Just to be clear, I don't mean to recompile flac with the above patch, > rather to install > http://hobbes.nmsu.edu/h-search.php?button=Search&key=flac-1.3.2.zip&dir=%2F > > and patch the installed header as well as create the import library as > below. > > R:\tmp>wlib flac.lib +FLAC8.dll > Open Watcom Library Manager Version 2.0beta1 Limited Availability > Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved. > Source code is available under the Sybase Open Watcom Public License. > See http://www.openwatcom.org/ for details. > Warning! Cannot open 'flac.lib' - library will be created > > Better would be for Flac to incorporate something like attached patch > (needs testing) and add > #define FLAC_API __declspec(__cdecl) > before including FLAC/all.hOK, I changed the patch to exports.h to be like the following: diff --git a/include/FLAC/export.h b/include/FLAC/export.h index d52f0bb..27b70af 100644 --- a/include/FLAC/export.h +++ b/include/FLAC/export.h @@ -57,7 +57,11 @@ */ #if defined(FLAC__NO_DLL) +#ifndef __OS2__ #define FLAC_API +#else +#define FLAC_API __declspec(__cdecl) +#endif #elif defined(_MSC_VER) #ifdef FLAC_API_EXPORTS @@ -66,6 +70,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(__cdecl) +#endif + #elif defined(FLAC__USE_VISIBILITY_ATTR) #define FLAC_API __attribute__ ((visibility ("default"))) It compiles with watcom OK. Apps link to it OK using watcom provided that exports.h is changed like above. Using the same exports.h, apps link to the import lib generated from the emx-compiled dll too. Question: Does emx support __declspec(dllexport) so I can adjust these changes? Because the emx build of the dll seems to have exported _everything_ :( -- O.S.
On 01/22/17 02:00 PM, Ozkan Sezer wrote:> Question: Does emx support __declspec(dllexport) so I can adjust > these changes? Because the emx build of the dll seems to have > exported_everything_ :(GCC supports __declspec(dllexport) though it still needs a def file, with no exports. Libtool doesn't currently and as flac uses libtool... Dave