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 3771 - more os2 bits: dynapi (and fix two bad patches)
Summary: more os2 bits: dynapi (and fix two bad patches)
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: x86 OS/2
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-24 02:03 UTC by Ozkan Sezer
Modified: 2017-08-28 01:54 UTC (History)
0 users

See Also:


Attachments
patch for SDL_thread.h (1.22 KB, patch)
2017-08-24 02:04 UTC, Ozkan Sezer
Details | Diff
patch for SDL_dynapi_procs.h (679 bytes, patch)
2017-08-24 02:04 UTC, Ozkan Sezer
Details | Diff
patch #1 for SDL_dynapi.c (880 bytes, patch)
2017-08-24 02:05 UTC, Ozkan Sezer
Details | Diff
patch #2 for SDL_dynapi.c (4.26 KB, patch)
2017-08-24 02:05 UTC, Ozkan Sezer
Details | Diff
patch for SDL_dynapi.h (456 bytes, patch)
2017-08-24 02:06 UTC, Ozkan Sezer
Details | Diff
patch #1 for SDL_dynapi.c (880 bytes, patch)
2017-08-24 10:16 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-24 02:03:27 UTC
more os2 bits: dynapi (and fix two bad patches)

Here are four patches for os/2: tested to work for me.


1. SDL_thread.h: fix os/2 defines (rev 11340:97cd834a843e was a missing patch)

2. SDL_dynapi_procs.h: adjust SDL_CreateThread for os/2

3. SDL_dynapi.c: fix os/2 build (rev 11345:6120f75935f9 merged a bad patch)

4. SDL_dynapi.c: add missing SDLCALL to macros.

5 (optional). SDL_dynapi.h: revert commit a6da0a386f68 in order to enable dynapi


Note: The patches from the following bugzilla entries are still needed for os/2:
Bug #3740: otherwise testime.c won't build.
Bug #3767: because watcom doesn't ship with scalbn (except for the openwatcom-v2
 fork at github.)
Bug #3769 and bug #3739: optional, not critical.
Comment 1 Ozkan Sezer 2017-08-24 02:04:03 UTC
Created attachment 2879 [details]
patch for SDL_thread.h
Comment 2 Ozkan Sezer 2017-08-24 02:04:33 UTC
Created attachment 2880 [details]
patch for SDL_dynapi_procs.h
Comment 3 Ozkan Sezer 2017-08-24 02:05:08 UTC
Created attachment 2881 [details]
patch #1 for SDL_dynapi.c
Comment 4 Ozkan Sezer 2017-08-24 02:05:38 UTC
Created attachment 2882 [details]
patch #2 for SDL_dynapi.c
Comment 5 Ozkan Sezer 2017-08-24 02:06:22 UTC
Created attachment 2883 [details]
patch for SDL_dynapi.h
Comment 6 Ozkan Sezer 2017-08-24 10:16:40 UTC
Created attachment 2884 [details]
patch #1 for SDL_dynapi.c

(correct patch this time. sigh..)
Comment 7 Ryan C. Gordon 2017-08-25 15:35:29 UTC

Attachment #2884 [details] already made it into revision control over on Bug #3765. The rest look reasonable. I'll get them in there soon.

--ryan.
Comment 8 Ozkan Sezer 2017-08-25 15:56:38 UTC
(In reply to Ryan C. Gordon from comment #7)
> 
> Attachment #2884 [details] already made it into revision control
> over on Bug #3765.

Well even that contained an inverted logic bug (see comment #6).
Fix:

diff --git a/src/dynapi/SDL_dynapi.c b/src/dynapi/SDL_dynapi.c
--- a/src/dynapi/SDL_dynapi.c
+++ b/src/dynapi/SDL_dynapi.c
@@ -244,7 +244,7 @@ static SDL_INLINE void *get_sdlapi_entry
     PFN retval = NULL;
     char error[256];
     if (NO_ERROR == DosLoadModule(&error, sizeof(error), fname, &hmodule)) {
-        if (NO_ERROR == DosQueryProcAddr(hmodule, 0, sym, &retval)) {
+        if (NO_ERROR != DosQueryProcAddr(hmodule, 0, sym, &retval)) {
             DosFreeModule(hmodule);
         }
     }


> The rest look reasonable. I'll get them in there soon.
> 
> --ryan.

Great, thanks!