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

Summary: more os2 bits: dynapi (and fix two bad patches)
Product: SDL Reporter: Ozkan Sezer <sezeroz>
Component: *don't know*Assignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: OS/2   
Attachments: patch for SDL_thread.h
patch for SDL_dynapi_procs.h
patch #1 for SDL_dynapi.c
patch #2 for SDL_dynapi.c
patch for SDL_dynapi.h
patch #1 for SDL_dynapi.c

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!