include: Fix symbols in public headers that start with an underscore. Fixes #7352.
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
diff --git a/include/begin_code.h b/include/begin_code.h
index 1f01e0b..4142ffe 100644
--- a/include/begin_code.h
+++ b/include/begin_code.h
@@ -28,10 +28,10 @@
*/
/* This shouldn't be nested -- included it around code only. */
-#ifdef _begin_code_h
+#ifdef SDL_begin_code_h
#error Nested inclusion of begin_code.h
#endif
-#define _begin_code_h
+#define SDL_begin_code_h
#ifndef SDL_DEPRECATED
# if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
@@ -171,17 +171,17 @@
#define SDL_FALLTHROUGH [[fallthrough]]
#else
#if defined(__has_attribute)
-#define _HAS_FALLTHROUGH __has_attribute(__fallthrough__)
+#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__)
#else
-#define _HAS_FALLTHROUGH 0
+#define SDL_HAS_FALLTHROUGH 0
#endif /* __has_attribute */
-#if _HAS_FALLTHROUGH && \
+#if SDL_HAS_FALLTHROUGH && \
((defined(__GNUC__) && __GNUC__ >= 7) || \
(defined(__clang_major__) && __clang_major__ >= 10))
#define SDL_FALLTHROUGH __attribute__((__fallthrough__))
#else
#define SDL_FALLTHROUGH do {} while (0) /* fallthrough */
-#endif /* _HAS_FALLTHROUGH */
-#undef _HAS_FALLTHROUGH
+#endif /* SDL_HAS_FALLTHROUGH */
+#undef SDL_HAS_FALLTHROUGH
#endif /* C++17 or C2x */
#endif /* SDL_FALLTHROUGH not defined */
diff --git a/include/close_code.h b/include/close_code.h
index 874a926..b5ff3e2 100644
--- a/include/close_code.h
+++ b/include/close_code.h
@@ -26,10 +26,10 @@
* after you finish any function and structure declarations in your headers
*/
-#ifndef _begin_code_h
+#ifndef SDL_begin_code_h
#error close_code.h included without matching begin_code.h
#endif
-#undef _begin_code_h
+#undef SDL_begin_code_h
/* Reset structure packing at previous byte alignment */
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)