# sdl12-compat: Apparently g++'s preprocessor defines \_\_unix\_\_ but not unix. :/

**URL:** <https://discourse.libsdl.org/t/sdl12-compat-apparently-g-s-preprocessor-defines-unix-but-not-unix/31927>\
**Category:** SDL Commits\
**Created:** [June 22, 2021, 4:12am UTC](https://discourse.libsdl.org/t/sdl12-compat-apparently-g-s-preprocessor-defines-unix-but-not-unix/31927 "2021-06-22T04:12:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [June 22, 2021, 4:12am UTC](https://discourse.libsdl.org/t/sdl12-compat-apparently-g-s-preprocessor-defines-unix-but-not-unix/31927/1 "2021-06-22T04:12:02Z")

</div>

> <https://github.com/libsdl-org/sdl12-compat/commit/e20b7fc8fe7a17caeb360fd85b19c598bf0c32fb>
>
> Fixes lincity-ng failing to compile with the replacement headers because
> iconv …wasn't set up correctly.

```diff
From e20b7fc8fe7a17caeb360fd85b19c598bf0c32fb Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 22 Jun 2021 00:09:41 -0400
Subject: [PATCH] Apparently g++'s preprocessor defines __unix__ but not unix. 
 :/

Fixes lincity-ng failing to compile with the replacement headers because
iconv wasn't set up correctly.
---
 include/SDL/SDL_config.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/SDL/SDL_config.h b/include/SDL/SDL_config.h
index 1a71bc0..56cbbe5 100644
--- a/include/SDL/SDL_config.h
+++ b/include/SDL/SDL_config.h
@@ -72,7 +72,7 @@ stage, though. Send patches if your platform lacks something. */
 #define HAVE_MATH_H 1
 #endif
 
-#if defined(unix) || defined( __APPLE__ )
+#if defined(unix) || defined( __unix__ ) || defined( __APPLE__ )
 #define HAVE_ICONV_H 1
 #define HAVE_SIGNAL_H 1
 #endif
@@ -156,7 +156,7 @@ stage, though. Send patches if your platform lacks something. */
 #define HAVE_SEM_TIMEDWAIT 1
 #endif
 
-#if defined(unix) || defined( __APPLE__ )
+#if defined(unix) || defined( __unix__ ) || defined( __APPLE__ )
 #define HAVE_ICONV 1
 #define HAVE_SIGACTION 1
 #define HAVE_SA_SIGACTION 1

```
