We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5394 - _DARWIN_C_SOURCE define clash
Summary: _DARWIN_C_SOURCE define clash
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: x86 macOS 10.15
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-12 18:58 UTC by Rene Dudfield
Modified: 2020-12-12 20:48 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rene Dudfield 2020-12-12 18:58:05 UTC
I'm getting lots of new warnings because of a clash with the python 3.8 define of the same name (_DARWIN_C_SOURCE). I guess other libraries are adding this in.


Maybe SDL_stdinc.h could be changed to guard against it?

#ifdef __APPLE__
#ifndef _DARWIN_C_SOURCE
#define _DARWIN_C_SOURCE /* for memset_pattern4() */
#endif
#endif



-------
In file included from /usr/local/include/SDL2/SDL.h:32:
In file included from /usr/local/include/SDL2/SDL_main.h:25:
/usr/local/include/SDL2/SDL_stdinc.h:34:9: warning: '_DARWIN_C_SOURCE' macro redefined [-Wmacro-redefined]
#define _DARWIN_C_SOURCE /* for memset_pattern4() */
        ^
/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyconfig.h:1569:9: note: previous definition is
      here
#define _DARWIN_C_SOURCE 1
        ^
1 warning generated.
Comment 1 Ozkan Sezer 2020-12-12 20:29:39 UTC
Should be fixed by https://hg.libsdl.org/SDL/rev/5f75d66e380a
If not, please drop a note here.

Closing as fixed.
Comment 2 Rene Dudfield 2020-12-12 20:48:31 UTC
Thanks!