From 8d14e6ea4415da0780df70b24abe2602c68d6e3e Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 8 Dec 2021 14:01:02 +0300
Subject: [PATCH] replaced use of _MAX_PATH with CCHMAXPATH in os/2 code,
it now compiles without HAVE_LIBC
---
include/SDL_config_os2.h | 7 ++++---
src/filesystem/os2/SDL_sysfilesystem.c | 6 +++---
src/video/os2/SDL_os2video.c | 2 +-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/include/SDL_config_os2.h b/include/SDL_config_os2.h
index d35bf6d3735..d3323321b8e 100644
--- a/include/SDL_config_os2.h
+++ b/include/SDL_config_os2.h
@@ -61,19 +61,20 @@
#define HAVE_LIBC 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_STDINT_H 1
+
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_STDDEF_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_WCHAR_H 1
#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H 1
#define HAVE_LIMITS_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
diff --git a/src/filesystem/os2/SDL_sysfilesystem.c b/src/filesystem/os2/SDL_sysfilesystem.c
index 86b6a409a24..30c7f41c645 100644
--- a/src/filesystem/os2/SDL_sysfilesystem.c
+++ b/src/filesystem/os2/SDL_sysfilesystem.c
@@ -25,9 +25,9 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* System dependent filesystem routines */
+#include "../../core/os2/SDL_os2.h"
#include "SDL_error.h"
#include "SDL_filesystem.h"
-#include "../../core/os2/SDL_os2.h"
#define INCL_DOSFILEMGR
#define INCL_DOSPROCESS
@@ -43,7 +43,7 @@ SDL_GetBasePath(void)
ULONG ulRC = DosGetInfoBlocks(&tib, &pib);
PCHAR pcEnd;
ULONG cbResult;
- CHAR acBuf[_MAX_PATH];
+ CHAR acBuf[CCHMAXPATH];
if (ulRC != NO_ERROR) {
debug_os2("DosGetInfoBlocks() failed, rc = %u", ulRC);
@@ -73,7 +73,7 @@ char *
SDL_GetPrefPath(const char *org, const char *app)
{
PSZ pszPath;
- CHAR acBuf[_MAX_PATH];
+ CHAR acBuf[CCHMAXPATH];
int lPosApp, lPosOrg;
PSZ pszApp, pszOrg;
diff --git a/src/video/os2/SDL_os2video.c b/src/video/os2/SDL_os2video.c
index 3c952b52a22..b0937ffa456 100644
--- a/src/video/os2/SDL_os2video.c
+++ b/src/video/os2/SDL_os2video.c
@@ -394,7 +394,7 @@ static MRESULT _wmDrop(WINDATA *pWinData, PDRAGINFO pDragInfo)
{
ULONG ulIdx;
PDRAGITEM pDragItem;
- CHAR acFName[_MAX_PATH];
+ CHAR acFName[CCHMAXPATH];
PCHAR pcFName;
if (!DrgAccessDraginfo(pDragInfo))