Skip to content

Wrap hrtime in C++ portability macros #4890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ext/standard/hrtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -53,4 +57,6 @@ PHP_MINIT_FUNCTION(hrtime);

PHP_FUNCTION(hrtime);

END_EXTERN_C()

#endif /* HRTIME_H */