]> granicus.if.org Git - php/commitdiff
Wrap hrtime in `extern "c" {}`
authorLevi Morrison <levim@php.net>
Wed, 6 Nov 2019 17:30:09 +0000 (10:30 -0700)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 7 Nov 2019 13:41:58 +0000 (14:41 +0100)
This allows it to be used by C++ extensions without them having to do their own forward declares.

Closes GH-4890.

ext/standard/hrtime.h

index c532845187e7018c7652d8ba723b8abdacda4170..1c08b0750265a43360a7b33d6422b8e04fed5067 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef HRTIME_H
 #define HRTIME_H
 
+#include <Zend/zend_portability.h>
+
 #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 */