os2: update include paths. add missing libc includes to geniconv.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
diff --git a/src/core/os2/SDL_os2.c b/src/core/os2/SDL_os2.c
index d42e668..d834891 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 a455c49..1ecaec1 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 b82e903..8ce7046 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 <os2.h>
-#include <iconv.h>
+
+#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 e22ce64..ca9f27f 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 dd9e83a..2e356a2 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 <os2.h>
#include <string.h>
#include <ctype.h>
+#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 1e2ba24..9e54f66 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 <uconv.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef ICONV_THREAD_SAFE
diff --git a/src/core/os2/geniconv/sys2utf8.c b/src/core/os2/geniconv/sys2utf8.c
index 51ce4a1..4fe906c 100644
--- a/src/core/os2/geniconv/sys2utf8.c
+++ b/src/core/os2/geniconv/sys2utf8.c
@@ -1,4 +1,4 @@
-#include <iconv.h>
+#include "geniconv.h"
#include <stdlib.h>
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 efd0b95..84dc6f9 100644
--- a/src/core/os2/geniconv/test.c
+++ b/src/core/os2/geniconv/test.c
@@ -1,8 +1,9 @@
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <geniconv.h>
+#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 7d08f94..4943ec1 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 0e90c4f..5894b8d 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 6aac3fd..3806914 100644
--- a/src/video/os2/SDL_os2util.h
+++ b/src/video/os2/SDL_os2util.h
@@ -30,9 +30,8 @@
#define INCL_GPI
#include <os2.h>
-/*#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 633efa2..4ba4e99 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 <os2.h>
-//#include <gradd.h> // 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 394c695..fe1952d 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 <os2.h>
+#include <gradd.h>
+#if 0 /* not used */
#define INCL_GRE_DEVICE
#define INCL_GRE_DEVMISC
#include <pmddi.h>
+#endif
#include "SDL_os2output.h"
-#include "gradd.h"
#include "SDL_os2video.h"
typedef struct _VODATA {