From e3527ec8e9c1171e90fc190f66715f6ee8ae2c32 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 6 Feb 2025 23:11:40 +0300
Subject: [PATCH] fix os/2 watcom builds using ow1.9
---
src/SDL12_compat.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 51e538035..9f16a96af 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -1187,6 +1187,8 @@ static void SDL12COMPAT_SetEnvAtStartup(const char *name, const char *value)
{
#ifdef _WIN32
SetEnvironmentVariableA(name, value);
+ #elif defined (__WATCOMC__)
+ setenv(name, value, 1); /* OW19 has no unsetenv(). NULL newvalue passed to setenv() behaves as unsetenv(). */
#else /* we might need other platforms, or a simple `return;` for platforms without an environment table. */
if (value) {
setenv(name, value, 1);