sdl12-compat: First attempt at replacement headers. Obviously a long way to go here. :)

From 7a71b8dc00f889aa1e7d7cd84089e594caa8d9c7 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Sun, 16 May 2021 23:45:46 -0400
Subject: [PATCH] First attempt at replacement headers. Obviously a long way to
 go here.  :)

---                   | 19 +++++++++++++++++++
 include/SDL/SDL.h           | 32 ++++++++++++++++++++++++++++++++
 src/SDL12_compat_objc.m     |  1 +
 src/SDL20_include_wrapper.h |  1 +
 4 files changed, 53 insertions(+)
 create mode 100644 include/SDL/SDL.h

diff --git a/ b/
index 9bb9fed..56cbc9c 100644
--- a/
+++ b/
@@ -15,3 +15,22 @@ If you absolutely must have the real SDL 1.2 ("SDL 1.2 Classic"), please use
 the source tree at, which occasionally
 gets bug fixes but no formal release. But we strongly encourage you not to do
+# How to use:
+- Build the library. This will need access to SDL2's headers, CMake
+( ) and the build tools of your choice. Once built, you
+will have a drop-in replacement that can be used with any existing binary
+that relies on SDL 1.2. You can copy this library over the existing 1.2 build,
+or force it to take priority over a system copy with LD_LIBRARY_PATH, etc.
+At runtime, sdl12-compat needs to be able to find a copy of SDL2, so plan to
+include it with the library if necessary.
+- If you want to build an SDL 1.2 program from source code, we have included
+compatibility headers, so that sdl12-compat can completely replace SDL 1.2
+at all points. These headers are just the bare minimum needed for source-level
+compatibility and don't have a lot of documentation or fanciness at all. The
+new headers are also under the zlib license. Note that sdl12-compat itself
+does not use these headers, so if you just want the library, you don't need
diff --git a/include/SDL/SDL.h b/include/SDL/SDL.h
new file mode 100644
index 0000000..0cc7fa3
--- /dev/null
+++ b/include/SDL/SDL.h
@@ -0,0 +1,32 @@
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2019 Sam Lantinga <>
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+#error You should not use these headers to build sdl12-compat. Use the real SDL2 headers instead.
+#ifndef _SDL_H
+#define _SDL_H
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/SDL12_compat_objc.m b/src/SDL12_compat_objc.m
index 8ad06ac..fc2b8fa 100644
--- a/src/SDL12_compat_objc.m
+++ b/src/SDL12_compat_objc.m
@@ -21,6 +21,7 @@
 /* This file contains some macOS-specific support code */
+#define __BUILDING_SDL12_COMPAT__ 1
 #include "SDL.h"
 #ifdef __MACOSX__
diff --git a/src/SDL20_include_wrapper.h b/src/SDL20_include_wrapper.h
index b4069e0..5c5b460 100644
--- a/src/SDL20_include_wrapper.h
+++ b/src/SDL20_include_wrapper.h
@@ -110,6 +110,7 @@
 #define INCL_DOSMODULEMGR /* for Dos_LoadModule() & co. */
+#define __BUILDING_SDL12_COMPAT__ 1
 #include "SDL.h"
 #include "SDL_syswm.h"    /* includes windows.h for _WIN32, os2.h for __OS2__ */