Skip to content

Commit b9dfa12

Browse files
morrisonlevinikic
authored andcommitted
Wrap hrtime in extern "c" {}
This allows it to be used by C++ extensions without them having to do their own forward declares. Closes GH-4890.
1 parent 6dcc0b8 commit b9dfa12

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/standard/hrtime.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#ifndef HRTIME_H
2121
#define HRTIME_H
2222

23+
#include <Zend/zend_portability.h>
24+
2325
#define PHP_HRTIME_PLATFORM_POSIX 0
2426
#define PHP_HRTIME_PLATFORM_WINDOWS 0
2527
#define PHP_HRTIME_PLATFORM_APPLE 0
@@ -45,6 +47,8 @@
4547

4648
#define HRTIME_AVAILABLE (PHP_HRTIME_PLATFORM_POSIX || PHP_HRTIME_PLATFORM_WINDOWS || PHP_HRTIME_PLATFORM_APPLE || PHP_HRTIME_PLATFORM_HPUX || PHP_HRTIME_PLATFORM_AIX)
4749

50+
BEGIN_EXTERN_C()
51+
4852
typedef uint64_t php_hrtime_t;
4953

5054
PHPAPI php_hrtime_t php_hrtime_current(void);
@@ -53,4 +57,6 @@ PHP_MINIT_FUNCTION(hrtime);
5357

5458
PHP_FUNCTION(hrtime);
5559

60+
END_EXTERN_C()
61+
5662
#endif /* HRTIME_H */

0 commit comments

Comments
 (0)