Avoid duplicate definition of feature macro
Feature macros need to be defined before #including any headers, preferably through the build system, but this is good enough. Fixes a compile error on my fork's Travis CI.
This commit is contained in:
parent
f70a0a996c
commit
899e1fbd94
@ -88,6 +88,11 @@
|
|||||||
|
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#if (defined(__linux__) || defined(PLATFORM_WEB)) && _POSIX_S_SOURCE < 199309L
|
||||||
|
#undef _POSIX_C_SOURCE
|
||||||
|
#define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2
|
#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2
|
||||||
#include "utils.h" // Required for: fopen() Android mapping
|
#include "utils.h" // Required for: fopen() Android mapping
|
||||||
|
|
||||||
@ -110,10 +115,6 @@
|
|||||||
#include "external/rgif.h" // Support GIF recording
|
#include "external/rgif.h" // Support GIF recording
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__) || defined(PLATFORM_WEB)
|
|
||||||
#define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h> // Standard input / output lib
|
#include <stdio.h> // Standard input / output lib
|
||||||
#include <stdlib.h> // Required for: malloc(), free(), rand(), atexit()
|
#include <stdlib.h> // Required for: malloc(), free(), rand(), atexit()
|
||||||
#include <stdint.h> // Required for: typedef unsigned long long int uint64_t, used by hi-res timer
|
#include <stdint.h> // Required for: typedef unsigned long long int uint64_t, used by hi-res timer
|
||||||
|
@ -148,7 +148,10 @@ float GetGesturePinchAngle(void); // Get gesture pinch ang
|
|||||||
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
|
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
|
||||||
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
|
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
#define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
|
#if _POSIX_C_SOURCE < 199309L
|
||||||
|
#undef _POSIX_C_SOURCE
|
||||||
|
#define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
|
||||||
|
#endif
|
||||||
#include <sys/time.h> // Required for: timespec
|
#include <sys/time.h> // Required for: timespec
|
||||||
#include <time.h> // Required for: clock_gettime()
|
#include <time.h> // Required for: clock_gettime()
|
||||||
#endif
|
#endif
|
||||||
|
28
src/physac.h
28
src/physac.h
@ -235,6 +235,22 @@ PHYSACDEF void ClosePhysics(void);
|
|||||||
|
|
||||||
#if defined(PHYSAC_IMPLEMENTATION)
|
#if defined(PHYSAC_IMPLEMENTATION)
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
// Functions required to query time on Windows
|
||||||
|
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
|
||||||
|
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
|
||||||
|
#elif (defined(__linux__) || defined(__APPLE__) || defined(PLATFORM_WEB))
|
||||||
|
#if _POSIX_C_SOURCE < 199309L
|
||||||
|
#undef _POSIX_C_SOURCE
|
||||||
|
#define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
|
||||||
|
#endif
|
||||||
|
//#define _DEFAULT_SOURCE // Enables BSD function definitions and C99 POSIX compliance
|
||||||
|
#include <sys/time.h> // Required for: timespec
|
||||||
|
#include <time.h> // Required for: clock_gettime()
|
||||||
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !defined(PHYSAC_NO_THREADS)
|
#if !defined(PHYSAC_NO_THREADS)
|
||||||
#include <pthread.h> // Required for: pthread_t, pthread_create()
|
#include <pthread.h> // Required for: pthread_t, pthread_create()
|
||||||
#endif
|
#endif
|
||||||
@ -248,18 +264,6 @@ PHYSACDEF void ClosePhysics(void);
|
|||||||
|
|
||||||
#include "raymath.h" // Required for: Vector2Add(), Vector2Subtract()
|
#include "raymath.h" // Required for: Vector2Add(), Vector2Subtract()
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
// Functions required to query time on Windows
|
|
||||||
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
|
|
||||||
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
|
|
||||||
#elif defined(__linux__) || defined(__APPLE__) || defined(PLATFORM_WEB)
|
|
||||||
#define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
|
|
||||||
//#define _DEFAULT_SOURCE // Enables BSD function definitions and C99 POSIX compliance
|
|
||||||
#include <sys/time.h> // Required for: timespec
|
|
||||||
#include <time.h> // Required for: clock_gettime()
|
|
||||||
#include <stdint.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Defines and Macros
|
// Defines and Macros
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user