zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

timeb.h (2324B) - Raw


      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _TIMEB_H_
      7 #define _TIMEB_H_
      8 
      9 #include <crtdefs.h>
     10 
     11 #ifndef _WIN32
     12 #error Only Win32 target is supported!
     13 #endif
     14 
     15 #pragma pack(push,_CRT_PACKING)
     16 
     17 #ifdef __cplusplus
     18 extern "C" {
     19 #endif
     20 
     21 #ifndef _CRTIMP
     22 #define _CRTIMP __declspec(dllimport)
     23 #endif
     24 
     25 #ifdef _USE_32BIT_TIME_T
     26 #ifdef _WIN64
     27 #undef _USE_32BIT_TIME_T
     28 #endif
     29 #endif
     30 
     31 #ifndef _TIME32_T_DEFINED
     32   typedef long __time32_t;
     33 #define _TIME32_T_DEFINED
     34 #endif
     35 
     36 #ifndef _TIME64_T_DEFINED
     37   __MINGW_EXTENSION typedef __int64 __time64_t;
     38 #define _TIME64_T_DEFINED
     39 #endif
     40 
     41 #ifndef _TIME_T_DEFINED
     42 #ifdef _USE_32BIT_TIME_T
     43   typedef __time32_t time_t;
     44 #else
     45   typedef __time64_t time_t;
     46 #endif
     47 #define _TIME_T_DEFINED
     48 #endif
     49 
     50 #ifndef _TIMEB_DEFINED
     51 #define _TIMEB_DEFINED
     52 
     53   struct __timeb32 {
     54     __time32_t time;
     55     unsigned short millitm;
     56     short timezone;
     57     short dstflag;
     58   };
     59 
     60 #ifndef	NO_OLDNAMES
     61   struct timeb {
     62     time_t time;
     63     unsigned short millitm;
     64     short timezone;
     65     short dstflag;
     66   };
     67 #endif
     68 
     69   struct __timeb64 {
     70     __time64_t time;
     71     unsigned short millitm;
     72     short timezone;
     73     short dstflag;
     74   };
     75 
     76 #endif
     77 
     78   _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time);
     79   _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time);
     80 
     81 #ifndef _USE_32BIT_TIME_T
     82 #define _timeb __timeb64
     83 #define _ftime _ftime64
     84 #else
     85 #define _timeb __timeb32
     86 #define _ftime _ftime32
     87 #endif
     88 
     89 struct _timespec32 {
     90   __time32_t tv_sec;
     91   long tv_nsec;
     92 };
     93 
     94 struct _timespec64 {
     95   __time64_t tv_sec;
     96   long tv_nsec;
     97 };
     98 
     99 #ifndef _TIMESPEC_DEFINED
    100 #define _TIMESPEC_DEFINED
    101 struct timespec {
    102   time_t  tv_sec;   /* Seconds */
    103   long    tv_nsec;  /* Nanoseconds */
    104 };
    105 
    106 struct itimerspec {
    107   struct timespec  it_interval;  /* Timer period */
    108   struct timespec  it_value;     /* Timer expiration */
    109 };
    110 #endif
    111 
    112 #if !defined (RC_INVOKED) && !defined (NO_OLDNAMES)
    113 #ifndef _USE_32BIT_TIME_T
    114   void __cdecl ftime (struct timeb *) __MINGW_ASM_CALL(_ftime64);
    115 #else
    116   void __cdecl ftime (struct timeb *) __MINGW_ASM_CALL(_ftime32);
    117 #endif /* _USE_32BIT_TIME_T */
    118 #endif
    119 
    120 #ifdef __cplusplus
    121 }
    122 #endif
    123 
    124 #pragma pack(pop)
    125 
    126 #include <sec_api/sys/timeb_s.h>
    127 #endif