X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=internals%2F_PDCLIB_int.h;h=af4c03377028477f9213a0bd36abf535acc01ad8;hb=48b352165d2cb89126ddde1323a138820687970a;hp=a46c2dc6c7f93014a58cb85a3949e976891ce821;hpb=ce0e5d8cd76b50f239fb8e95170502b146247b35;p=pdclib diff --git a/internals/_PDCLIB_int.h b/internals/_PDCLIB_int.h index a46c2dc..af4c033 100644 --- a/internals/_PDCLIB_int.h +++ b/internals/_PDCLIB_int.h @@ -1,4 +1,5 @@ -/* $Id$ */ +#ifndef _PDCLIB_INT_H +#define _PDCLIB_INT_H /* PDCLib internal integer logic <_PDCLIB_int.h> @@ -11,15 +12,8 @@ /* would be considered a bug / missing feature: notify the author(s). */ /* -------------------------------------------------------------------------- */ -#ifndef _PDCLIB_CONFIG_H -#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H #include <_PDCLIB_config.h> -#endif - -#ifndef _PDCLIB_AUX_H -#define _PDCLIB_AUX_H _PDCLIB_AUX_H #include <_PDCLIB_aux.h> -#endif /* null pointer constant */ #define _PDCLIB_NULL 0 @@ -254,6 +248,36 @@ typedef unsigned _PDCLIB_intmax _PDCLIB_uintmax_t; #define _PDCLIB_INTMAX_C( value ) _PDCLIB_concat( value, _PDCLIB_INTMAX_LITERAL ) #define _PDCLIB_UINTMAX_C( value ) _PDCLIB_concat( value, _PDCLIB_concat( u, _PDCLIB_INTMAX_LITERAL ) ) +/* -------------------------------------------------------------------------- */ +/* Various internals */ +/* -------------------------------------------------------------------------- */ + +typedef _PDCLIB_time _PDCLIB_time_t; +typedef _PDCLIB_clock _PDCLIB_clock_t; + +#if !defined(_PDCLIB_DEFINE_STRUCT_TIMESPEC) +#define _PDCLIB_DEFINE_STRUCT_TIMESPEC() \ + struct timespec { \ + time_t tv_sec; \ + long tv_nsec; \ + }; +#endif + +#if !defined(_PDCLIB_DEFINE_STRUCT_TM) +#define _PDCLIB_DEFINE_STRUCT_TM() \ + struct tm { \ + int tm_sec; \ + int tm_min; \ + int tm_hour; \ + int tm_mday; \ + int tm_mon; \ + int tm_year; \ + int tm_wday; \ + int tm_yday; \ + int tm_isdst; \ + }; +#endif + /* -------------------------------------------------------------------------- */ /* Various internals */ /* -------------------------------------------------------------------------- */ @@ -417,7 +441,7 @@ extern int _PDCLIB_errno; /* A mechanism for delayed evaluation. (Not sure if this is really necessary, so no detailed documentation on the "why".) */ -int * _PDCLIB_errno_func( void ); +int * _PDCLIB_errno_func( void ) _PDCLIB_nothrow; /* -------------------------------------------------------------------------- */ /* lookup tables */ @@ -442,3 +466,4 @@ struct _PDCLIB_ctype_t unsigned char collation; }; +#endif