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

Summary: _DARWIN_C_SOURCE define clash
Product: SDL Reporter: Rene Dudfield <renesd>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: HG 2.0   
Hardware: x86   
OS: macOS 10.15   

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!