Fix windows and cpp compatibility (#2887)
This commit is contained in:
parent
1c9f93f7ef
commit
215e49253d
3 changed files with 17 additions and 6 deletions
|
|
@ -51,6 +51,7 @@ include_files = [
|
|||
'rz_types_overflow.h',
|
||||
'rz_util.h',
|
||||
'rz_vector.h',
|
||||
'rz_windows.h',
|
||||
'rz_windows_heap.h',
|
||||
]
|
||||
install_headers(include_files, install_dir: rizin_incdir)
|
||||
|
|
|
|||
|
|
@ -12,16 +12,22 @@
|
|||
|
||||
#define ASCTIME_BUF_MINLEN 26
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
struct timeval;
|
||||
|
||||
struct timezone {
|
||||
struct rz_timezone {
|
||||
int tz_minuteswest; /* minutes W of Greenwich */
|
||||
int tz_dsttime; /* type of dst correction */
|
||||
};
|
||||
#else
|
||||
#define rz_timezone timezone
|
||||
#endif
|
||||
|
||||
RZ_API int rz_time_gettimeofday(struct timeval *p, struct timezone *tz);
|
||||
RZ_API int rz_time_gettimeofday(struct timeval *p, struct rz_timezone *tz);
|
||||
|
||||
// wall clock time in microseconds
|
||||
RZ_API ut64 rz_time_now(void);
|
||||
|
|
@ -58,4 +64,8 @@ RZ_API struct tm *rz_gmtime_r(RZ_NONNULL const time_t *time, RZ_NONNULL struct t
|
|||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
* information.
|
||||
*
|
||||
* \param p Pointer to a \p timeval structure that will be filled by this function
|
||||
* \param tz Pointer to a \p timezone structure that will be filled by this function
|
||||
* \param tz Pointer to a \p rz_timezone structure that will be filled by this function
|
||||
* \return 0 if the function succeeds, -1 on error
|
||||
*/
|
||||
RZ_API int rz_time_gettimeofday(struct timeval *p, struct timezone *tz) {
|
||||
RZ_API int rz_time_gettimeofday(struct timeval *p, struct rz_timezone *tz) {
|
||||
// ULARGE_INTEGER ul; // As specified on MSDN.
|
||||
ut64 ul = 0;
|
||||
static int tzflag = 0;
|
||||
|
|
@ -72,10 +72,10 @@ RZ_API int rz_time_gettimeofday(struct timeval *p, struct timezone *tz) {
|
|||
* information.
|
||||
*
|
||||
* \param p Pointer to a \p timeval structure that will be filled by this function
|
||||
* \param tz Pointer to a \p timezone structure that will be filled by this function
|
||||
* \param tz Pointer to a \p rz_timezone structure that will be filled by this function
|
||||
* \return 0 if the function succeeds, -1 on error
|
||||
*/
|
||||
RZ_API int rz_time_gettimeofday(struct timeval *p, struct timezone *tz) {
|
||||
RZ_API int rz_time_gettimeofday(struct timeval *p, struct rz_timezone *tz) {
|
||||
return gettimeofday(p, tz);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue