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 3476 - round() needs _GNU_SOURCE on some old systems
Summary: round() needs _GNU_SOURCE on some old systems
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.5
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-28 19:09 UTC by Ozkan Sezer
Modified: 2016-11-06 17:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2016-10-28 19:09:04 UTC
On systems with old glibc, such mine with glibc-2.8, the following warning
is issued and is fixed easily by defining _GNU_SOURCE:

/home/me/SDL2-2.0.5/src/video/x11/SDL_x11modes.c: In function 'CalculateXRandRRefreshRate':
/home/me/SDL2-2.0.5/src/video/x11/SDL_x11modes.c:263: warning: implicit declaration of function 'round'
/home/me/SDL2-2.0.5/src/video/x11/SDL_x11modes.c:263: warning: incompatible implicit declaration of built-in function 'round'


--- SDL2-2.0.5/src/video/x11/SDL_x11modes.c~
+++ SDL2-2.0.5/src/video/x11/SDL_x11modes.c
@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
 #include "../../SDL_internal.h"
 
 #if SDL_VIDEO_DRIVER_X11
Comment 1 Ozkan Sezer 2016-11-04 08:18:11 UTC
Tested this on new distros too, seen no unwanted effects (as expected.)
Comment 2 Sam Lantinga 2016-11-06 17:30:38 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/c8ca00149330