mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
You can't combine SDL_STRINGIFY_ARG() and SDL_FUNCTION
Removed obsolete documentation that shows this usage and macros that attempt it.
Also allow SDL_FUNCTION to be redefined by the application.
Fixes https://github.com/libsdl-org/SDL/issues/15004
(cherry picked from commit 6feb0e1333)
This commit is contained in:
parent
576c2d2f2c
commit
badd9e5a15
9 changed files with 97 additions and 127 deletions
|
|
@ -160,7 +160,7 @@ extern "C" {
|
|||
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||
|
||||
/**
|
||||
* A macro that reports the current function being compiled.
|
||||
* A constant that contains the current function being compiled.
|
||||
*
|
||||
* If SDL can't figure how the compiler reports this, it will use "???".
|
||||
*
|
||||
|
|
@ -168,13 +168,15 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_FUNCTION __FUNCTION__
|
||||
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
||||
#elif !defined(SDL_FUNCTION)
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
||||
# define SDL_FUNCTION __func__
|
||||
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
|
||||
# define SDL_FUNCTION __FUNCTION__
|
||||
#else
|
||||
# define SDL_FUNCTION "???"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||
|
||||
|
|
|
|||
|
|
@ -254,12 +254,6 @@ void *alloca(size_t);
|
|||
/**
|
||||
* Macro useful for building other macros with strings in them.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* ```c
|
||||
* #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(SDL_FUNCTION) ": " X "\n")`
|
||||
* ```
|
||||
*
|
||||
* \param arg the text to turn into a string literal.
|
||||
*
|
||||
* \since This macro is available since SDL 3.2.0.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue