浏览代码

Merge pull request #301 from jubalh/time

Add define to have CLOCK_MONOTONIC work in c99
pull/303/head
Ray 7 年前
committed by GitHub
父节点
当前提交
4b1bc7f65e
共有 3 个文件被更改,包括 8 次插入2 次删除
  1. +4
    -0
      src/core.c
  2. +3
    -2
      src/gestures.h
  3. +1
    -0
      src/physac.h

+ 4
- 0
src/core.c 查看文件

@ -109,6 +109,10 @@
#include "external/gif.h" // Support GIF recording #include "external/gif.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

+ 3
- 2
src/gestures.h 查看文件

@ -148,8 +148,9 @@ 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__)
#include <sys/time.h> // Required for: timespec #define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
#include <time.h> // Required for: clock_gettime() #include <sys/time.h> // Required for: timespec
#include <time.h> // Required for: clock_gettime()
#endif #endif
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------

+ 1
- 0
src/physac.h 查看文件

@ -253,6 +253,7 @@ PHYSACDEF void ClosePhysics(void);
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__) || defined(PLATFORM_WEB) #elif defined(__linux__) || 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 //#define _DEFAULT_SOURCE // Enables BSD function definitions and C99 POSIX compliance
#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()

||||||
x
 
000:0
正在加载...
取消
保存