From 95306d6999c5cb2f81e95ffa0767dfc7c50dff47 Mon Sep 17 00:00:00 2001 From: Levi Morrison Date: Wed, 6 Nov 2019 10:30:09 -0700 Subject: [PATCH] Wrap hrtime in `extern "c" {}` This allows it to be used by C++ extensions without them having to do their own forward declares. --- ext/standard/hrtime.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/standard/hrtime.h b/ext/standard/hrtime.h index c532845187e70..717bd867e1b5a 100644 --- a/ext/standard/hrtime.h +++ b/ext/standard/hrtime.h @@ -20,6 +20,8 @@ #ifndef HRTIME_H #define HRTIME_H +#include + #define PHP_HRTIME_PLATFORM_POSIX 0 #define PHP_HRTIME_PLATFORM_WINDOWS 0 #define PHP_HRTIME_PLATFORM_APPLE 0 @@ -45,6 +47,8 @@ #define HRTIME_AVAILABLE (PHP_HRTIME_PLATFORM_POSIX || PHP_HRTIME_PLATFORM_WINDOWS || PHP_HRTIME_PLATFORM_APPLE || PHP_HRTIME_PLATFORM_HPUX || PHP_HRTIME_PLATFORM_AIX) +BEGIN_EXTERN_C() + typedef uint64_t php_hrtime_t; PHPAPI php_hrtime_t php_hrtime_current(void); @@ -53,4 +57,6 @@ PHP_MINIT_FUNCTION(hrtime); PHP_FUNCTION(hrtime); +END_EXTERN_C() + #endif /* HRTIME_H */