From 110a0f7bb1c9c511f06fef45ebf99839a76a6bee Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 14 Oct 2020 23:01:01 +0300 Subject: [PATCH] os2: update include paths. add missing libc includes to geniconv. --- src/core/os2/SDL_os2.c | 2 +- src/core/os2/SDL_os2.h | 15 ++++++--------- src/core/os2/geniconv/geniconv.c | 4 ++-- src/core/os2/geniconv/geniconv.h | 8 ++++---- src/core/os2/geniconv/os2cp.c | 3 ++- src/core/os2/geniconv/os2iconv.c | 4 ++-- src/core/os2/geniconv/sys2utf8.c | 5 ++--- src/core/os2/geniconv/test.c | 8 +++++--- src/loadso/os2/SDL_sysloadso.c | 2 +- src/video/os2/SDL_os2output.h | 4 ++-- src/video/os2/SDL_os2util.h | 5 ++--- src/video/os2/SDL_os2video.h | 4 +--- src/video/os2/SDL_os2vman.c | 6 ++++-- 13 files changed, 34 insertions(+), 36 deletions(-) diff --git a/src/core/os2/SDL_os2.c b/src/core/os2/SDL_os2.c index d42e668cc..d834891e9 100644 --- a/src/core/os2/SDL_os2.c +++ b/src/core/os2/SDL_os2.c @@ -22,7 +22,7 @@ #if defined(__OS2__) -#include "core/os2/geniconv/geniconv.h" +#include "geniconv/geniconv.h" // SDL_OS2Quit() will be called from SDL_QuitSubSystem(). diff --git a/src/core/os2/SDL_os2.h b/src/core/os2/SDL_os2.h index a455c49e4..1ecaec1a5 100644 --- a/src/core/os2/SDL_os2.h +++ b/src/core/os2/SDL_os2.h @@ -1,31 +1,28 @@ -#ifndef _SDL_os2_h -#define _SDL_os2_h +#ifndef SDL_os2_h_ +#define SDL_os2_h_ #include "SDL_log.h" #include "SDL_stdinc.h" -#include ".\src\core\os2\geniconv\geniconv.h" +#include "geniconv/geniconv.h" #if OS2DEBUG==SDLOUTPUT - # define debug(s,...) SDL_LogDebug( SDL_LOG_CATEGORY_APPLICATION, \ __func__"(): "##s, ##__VA_ARGS__ ) - #elif defined(OS2DEBUG) - # define debug(s,...) printf( __func__"(): "##s"\n", ##__VA_ARGS__ ) #else # define debug(s,...) -#endif // OS2DEBUG +#endif /* OS2DEBUG */ -// StrUTF8New() - geniconv\sys2utf8.c. +// StrUTF8New() - geniconv/sys2utf8.c. #define OS2_SysToUTF8(S) StrUTF8New( 1, S, SDL_strlen( S ) + 1 ) #define OS2_UTF8ToSys(S) StrUTF8New( 0, (char *)(S), SDL_strlen( S ) + 1 ) // SDL_OS2Quit() will be called from SDL_QuitSubSystem(). void SDL_OS2Quit(); -#endif // _SDL_os2_h +#endif /* SDL_os2_h_ */ diff --git a/src/core/os2/geniconv/geniconv.c b/src/core/os2/geniconv/geniconv.c index b82e903d1..8ce7046c6 100644 --- a/src/core/os2/geniconv/geniconv.c +++ b/src/core/os2/geniconv/geniconv.c @@ -7,7 +7,8 @@ #define INCL_DOSMODULEMGR /* Module Manager values */ #define INCL_DOSERRORS /* Error values */ #include -#include + +#include "geniconv.h" //#define DEBUG @@ -107,7 +108,6 @@ static void _init() } - // Public routines. // ---------------- diff --git a/src/core/os2/geniconv/geniconv.h b/src/core/os2/geniconv/geniconv.h index e22ce640d..ca9f27f6c 100644 --- a/src/core/os2/geniconv/geniconv.h +++ b/src/core/os2/geniconv/geniconv.h @@ -37,16 +37,16 @@ int libiconv_close(iconv_t cd); // System codepage <-> UTF-8. // StrUTF8() -// Coverts string from system cp. to UTF-8 (fToUTF8 is not 0) or from UTF-8 to -// the system cp. (fToUTF8 is 0). Converted ASCIIZ string will be placed at the +// Coverts string from system cp to UTF-8 (fToUTF8 is not 0) or from UTF-8 to +// the system cp (fToUTF8 is 0). Converted ASCIIZ string will be placed at the // buffer pcDst, up to cbDst - 1 (for sys->utf8) or 2 (for utf8->sys) bytes. // Returns the number of bytes written into pcDst, not counting the terminating // 0 byte(s) or -1 on error. int StrUTF8(int fToUTF8, char *pcDst, int cbDst, char *pcSrc, int cbSrc); // StrUTF8New() -// Coverts string from system cp. to UTF-8 (fToUTF8 is not 0) or from UTF-8 to -// the system cp. (fToUTF8 is 0). Memory for the new string is obtained by +// Coverts string from system cp to UTF-8 (fToUTF8 is not 0) or from UTF-8 to +// the system cp (fToUTF8 is 0). Memory for the new string is obtained by // using libc malloc(). // Returns converted string, terminating two bytes 0 is appended to the result. // Returns null on error. diff --git a/src/core/os2/geniconv/os2cp.c b/src/core/os2/geniconv/os2cp.c index dd9e83a91..2e356a228 100644 --- a/src/core/os2/geniconv/os2cp.c +++ b/src/core/os2/geniconv/os2cp.c @@ -1,10 +1,11 @@ -#include "os2cp.h" #define INCL_DOSNLS #define INCL_DOSERRORS #include #include #include +#include "os2cp.h" + typedef struct _CP2NAME { ULONG ulCode; PSZ pszName; diff --git a/src/core/os2/geniconv/os2iconv.c b/src/core/os2/geniconv/os2iconv.c index 1e2ba2457..9e54f66dc 100644 --- a/src/core/os2/geniconv/os2iconv.c +++ b/src/core/os2/geniconv/os2iconv.c @@ -5,10 +5,10 @@ */ #define ICONV_THREAD_SAFE 1 -//#undef ICONV_THREAD_SAFE -#include "iconv.h" +#include "geniconv.h" #include +#include #include #include #ifdef ICONV_THREAD_SAFE diff --git a/src/core/os2/geniconv/sys2utf8.c b/src/core/os2/geniconv/sys2utf8.c index 51ce4a146..4fe906c1c 100644 --- a/src/core/os2/geniconv/sys2utf8.c +++ b/src/core/os2/geniconv/sys2utf8.c @@ -1,4 +1,4 @@ -#include +#include "geniconv.h" #include int StrUTF8(int fToUTF8, char *pcDst, int cbDst, char *pcSrc, int cbSrc) @@ -47,8 +47,7 @@ int StrUTF8(int fToUTF8, char *pcDst, int cbDst, char *pcSrc, int cbSrc) iconv_close( cd ); - // Write trailing ZERO (1 byte for UTF-8, 2 bytes for the system cp.). - + // Write trailing ZERO (1 byte for UTF-8, 2 bytes for the system cp). if ( fToUTF8 ) { if ( cbDst < 1 ) diff --git a/src/core/os2/geniconv/test.c b/src/core/os2/geniconv/test.c index efd0b95b7..84dc6f959 100644 --- a/src/core/os2/geniconv/test.c +++ b/src/core/os2/geniconv/test.c @@ -1,8 +1,9 @@ +#include #include #include -#include +#include "geniconv.h" -void main() +int main(void) { char acBuf[128]; char *inbuf = "Тест - проверка"; // KOI8-R string. @@ -17,7 +18,7 @@ void main() if ( ic == (iconv_t)(-1) ) { puts( "iconv_open() fail" ); - return; + return 1; } iconv( ic, &inbuf, &inbytesleft, &outbuf, &outbytesleft ); @@ -42,4 +43,5 @@ void main() iconv_clean(); puts( "Done." ); + return 0; } diff --git a/src/loadso/os2/SDL_sysloadso.c b/src/loadso/os2/SDL_sysloadso.c index 7d08f94b5..4943ec19e 100644 --- a/src/loadso/os2/SDL_sysloadso.c +++ b/src/loadso/os2/SDL_sysloadso.c @@ -26,7 +26,7 @@ /* System dependent library loading routines */ #include "SDL_loadso.h" -#include ".\core\os2\SDL_os2.h" +#include "../../core/os2/SDL_os2.h" #define INCL_DOSMODULEMGR #define INCL_DOSERRORS diff --git a/src/video/os2/SDL_os2output.h b/src/video/os2/SDL_os2output.h index 0e90c4f82..5894b8d64 100644 --- a/src/video/os2/SDL_os2output.h +++ b/src/video/os2/SDL_os2output.h @@ -21,7 +21,7 @@ #ifndef _SDL_os2output_ #define _SDL_os2output_ -#include ".\core\os2\SDL_os2.h" +#include "../../core/os2/SDL_os2.h" typedef struct _VODATA *PVODATA; @@ -51,4 +51,4 @@ typedef struct _OS2VIDEOOUTPUT { extern OS2VIDEOOUTPUT voDive; extern OS2VIDEOOUTPUT voVMan; -#endif // _SDL_os2output_ +#endif /* _SDL_os2output_ */ diff --git a/src/video/os2/SDL_os2util.h b/src/video/os2/SDL_os2util.h index 6aac3fd25..380691432 100644 --- a/src/video/os2/SDL_os2util.h +++ b/src/video/os2/SDL_os2util.h @@ -30,9 +30,8 @@ #define INCL_GPI #include -/*#define debug(s,...) SDL_LogDebug( SDL_LOG_CATEGORY_VIDEO, \ - __func__"(): "##s, ##__VA_ARGS__ )*/ +/*#define debug(s,...) SDL_LogDebug( SDL_LOG_CATEGORY_VIDEO, __func__"(): "##s, ##__VA_ARGS__ )*/ HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY); -#endif // _SDL_os2util_h +#endif /* _SDL_os2util_h */ diff --git a/src/video/os2/SDL_os2video.h b/src/video/os2/SDL_os2video.h index 633efa25d..4ba4e991d 100644 --- a/src/video/os2/SDL_os2video.h +++ b/src/video/os2/SDL_os2video.h @@ -24,7 +24,7 @@ #define _SDL_os2video_h #include "../SDL_sysvideo.h" -#include ".\core\os2\SDL_os2.h" +#include "../../core/os2/SDL_os2.h" #define INCL_DOS #define INCL_DOSERRORS @@ -34,8 +34,6 @@ #define INCL_OS2MM #define INCL_DOSMEMMGR #include -//#include // Defines FOURCC_xxxx - #include "SDL_os2mouse.h" #include "SDL_os2output.h" diff --git a/src/video/os2/SDL_os2vman.c b/src/video/os2/SDL_os2vman.c index 394c69553..fe1952d1a 100644 --- a/src/video/os2/SDL_os2vman.c +++ b/src/video/os2/SDL_os2vman.c @@ -25,13 +25,15 @@ #define INCL_DOSMODULEMGR #define INCL_WIN #define INCL_GPI -#define INCL_GPIBITMAPS // GPI bit map functions +#define INCL_GPIBITMAPS /* GPI bit map functions */ #include +#include +#if 0 /* not used */ #define INCL_GRE_DEVICE #define INCL_GRE_DEVMISC #include +#endif #include "SDL_os2output.h" -#include "gradd.h" #include "SDL_os2video.h" typedef struct _VODATA {