We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3758 - watcom support
Summary: watcom support
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: x86 Other
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-17 22:22 UTC by Ozkan Sezer
Modified: 2017-08-18 20:57 UTC (History)
0 users

See Also:


Attachments
SDL_MostSignificantBitIndex32 patch (987 bytes, patch)
2017-08-17 22:24 UTC, Ozkan Sezer
Details | Diff
byteswap patch (1.02 KB, patch)
2017-08-17 22:24 UTC, Ozkan Sezer
Details | Diff
debugbreak patch (804 bytes, patch)
2017-08-17 22:24 UTC, Ozkan Sezer
Details | Diff
atomics patch (5.51 KB, patch)
2017-08-17 22:25 UTC, Ozkan Sezer
Details | Diff
__FUNCTION__ patch (1.62 KB, patch)
2017-08-17 22:25 UTC, Ozkan Sezer
Details | Diff
atomics patch #2 (5.65 KB, patch)
2017-08-18 09:18 UTC, Ozkan Sezer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2017-08-17 22:22:20 UTC
following small patches adds Open Watcom compiler support to target x86:

1. adds __builtin_clz equivalent for Watcom/x86 as inline asm
2. adds SDL_Swap16 and SDL_Swap32 for Watcom/x86 as inline asm
3. adds inline asm (int 0x03) as SDL_TriggerBreakpoint for Watcom/x86
4. adds atomics for Watcom/x86 as inline asm
5. adjusts ifdefs about __FUNCTION__ identifier
Comment 1 Ozkan Sezer 2017-08-17 22:24:03 UTC
Created attachment 2857 [details]
SDL_MostSignificantBitIndex32 patch
Comment 2 Ozkan Sezer 2017-08-17 22:24:30 UTC
Created attachment 2858 [details]
byteswap patch
Comment 3 Ozkan Sezer 2017-08-17 22:24:55 UTC
Created attachment 2859 [details]
debugbreak patch
Comment 4 Ozkan Sezer 2017-08-17 22:25:19 UTC
Created attachment 2860 [details]
atomics patch
Comment 5 Ozkan Sezer 2017-08-17 22:25:48 UTC
Created attachment 2861 [details]
__FUNCTION__ patch
Comment 6 Ryan C. Gordon 2017-08-18 00:46:56 UTC
...is there a big OS/2 patch incoming?   :)

--ryan.
Comment 7 Ozkan Sezer 2017-08-18 00:52:45 UTC
> ...is there a big OS/2 patch incoming?   :)
> 
> --ryan.

I only wanted to have the baseline ready for an os/2 port. I actually
have it up and running, but it's not mine to submit: it's based on an
SDL2-2.0.4 port by Andrey Vasilkin (digi@os2.snc.ru); I'll notify him
of this bugzilla entry now.
Comment 8 Ryan C. Gordon 2017-08-18 03:53:11 UTC
(In reply to Ozkan Sezer from comment #7)
> I only wanted to have the baseline ready for an os/2 port. I actually
> have it up and running, but it's not mine to submit: it's based on an
> SDL2-2.0.4 port by Andrey Vasilkin (digi@os2.snc.ru); I'll notify him
> of this bugzilla entry now.

Should I post these with "Ozkan Sezer <sezeroz@gmail.com>" as the committer's name, or are these Andrey's, and if they are Andrey's, we're allowed to take these, right?

--ryan.
Comment 9 Ozkan Sezer 2017-08-18 08:10:53 UTC
> Should I post these with "Ozkan Sezer <sezeroz@gmail.com>" as the
> committer's name, or are these Andrey's, and if they are Andrey's,
> we're allowed to take these, right?
> 
> --ryan.

Only the SDL_spinlock.c part of them are from Andrey's with some
reformatting by me; but that asm is common knowledge.  The rest are
mine based on common knowledge.
Comment 10 Ozkan Sezer 2017-08-18 09:18:26 UTC
Created attachment 2862 [details]
atomics patch #2

> Only the SDL_spinlock.c part of them are from Andrey's with some
> reformatting by me; but that asm is common knowledge.

Here, I replaced those parts in SDL_spinlock.c too (possibly even for better.)
Comment 11 Ryan C. Gordon 2017-08-18 20:44:27 UTC
These patches are now:

https://hg.libsdl.org/SDL/rev/d66e1e9ab531
https://hg.libsdl.org/SDL/rev/0f1c85713294
https://hg.libsdl.org/SDL/rev/76abc6e1eb4b
https://hg.libsdl.org/SDL/rev/f57e81db97b5
https://hg.libsdl.org/SDL/rev/06fd8421e8f6

I put your second atomics patch in. I have no objection to incorporating Andrey's work, but since he's crowdfunding OS/2 ports of various projects, I would absolutely want to respect his wishes if he feels it would encroach on his income to do so.

--ryan.
Comment 12 Ozkan Sezer 2017-08-18 20:57:55 UTC
Thank you.  (There remains three bugs now, namely #3739, #3740 and #3756
regarding os/2.)