From dd81f512804a0fd9e24450a7e7cbf923967cf885 Mon Sep 17 00:00:00 2001 From: Connor Date: Sat, 3 Mar 2018 15:49:11 -0800 Subject: [PATCH] --- clock.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/clock.h b/clock.h index cc77983..9035d79 100644 --- a/clock.h +++ b/clock.h @@ -127,9 +127,9 @@ struct PsnipClockTimespec { # endif # endif # if !defined(PSNIP_CLOCK_MONOTONIC_METHOD) -# if defined(CLOCK_MONOTONIC_RAW) +# if defined(CLOCK_MONOTONIC_RAW) && !defined(__EMSCRIPTEN__) # define PSNIP_CLOCK_MONOTONIC_METHOD PSNIP_CLOCK_METHOD_CLOCK_GETTIME -# define PSNIP_CLOCK_CLOCK_GETTIME_MONOTONIC CLOCK_MONOTONIC +# define PSNIP_CLOCK_CLOCK_GETTIME_MONOTONIC CLOCK_MONOTONIC_RAW # elif defined(CLOCK_MONOTONIC_PRECISE) # define PSNIP_CLOCK_MONOTONIC_METHOD PSNIP_CLOCK_METHOD_CLOCK_GETTIME # define PSNIP_CLOCK_CLOCK_GETTIME_MONOTONIC CLOCK_MONOTONIC_PRECISE @@ -203,10 +203,15 @@ typedef union _LARGE_INTEGER { } u; int64_t QuadPart; } LARGE_INTEGER; -void * __stdcall GetCurrentProcess(void); -int __stdcall QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency); -int __stdcall QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount); -int __stdcall GetProcessTimes( +#ifdef __cplusplus +#define PSNIP_EXTERN extern "C" +#else +#define PSNIP_EXTERN +#endif +PSNIP_EXTERN void * __stdcall GetCurrentProcess(void); +PSNIP_EXTERN int __stdcall QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency); +PSNIP_EXTERN int __stdcall QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount); +PSNIP_EXTERN int __stdcall GetProcessTimes( void *hProcess, FILETIME *lpCreationTime, FILETIME *lpExitTime,