Allow platform to *not* include some header files
[fw/pdclib] / platform / altos / internals / _PDCLIB_config.h
index 64cc98dc73411bcc4e854ff936e09ab0d2e76f63..985fc6d4b6aa7db042c59212c1150b25579d2fd8 100644 (file)
@@ -156,6 +156,7 @@ struct _PDCLIB_lldiv_t
 
 /* Largest supported integer type. Implementation note: see _PDCLIB_atomax(). */
 #define _PDCLIB_intmax long long int
+typedef _PDCLIB_intmax intmax_t;
 #define _PDCLIB_INTMAX LLONG
 #define _PDCLIB_MAX_CONV ll
 /* You are also required to state the literal suffix for the intmax type      */
@@ -224,11 +225,13 @@ struct _PDCLIB_imaxdiv_t
 /* Internal helper macro. va_round is not part of <stdarg.h>. */
 #define _PDCLIB_va_round( type ) ( (sizeof(type) + sizeof(void *) - 1) & ~(sizeof(void *) - 1) )
 
-typedef char * _PDCLIB_va_list;
-#define _PDCLIB_va_arg( ap, type ) ( (ap) += (_PDCLIB_va_round(type)), ( *(type*) ( (ap) - (_PDCLIB_va_round(type)) ) ) )
-#define _PDCLIB_va_copy( dest, src ) ( (dest) = (src), (void)0 )
-#define _PDCLIB_va_end( ap ) ( (ap) = (void *)0, (void)0 )
-#define _PDCLIB_va_start( ap, parmN ) ( (ap) = (char *) &parmN + ( _PDCLIB_va_round(parmN) ), (void)0 )
+#include <stdarg.h>
+
+#define _PDCLIB_va_list va_list
+#define _PDCLIB_va_arg( ap, type ) va_arg(ap, type)
+#define _PDCLIB_va_copy( dest, src ) va_copy(dest, src)
+#define _PDCLIB_va_end( ap ) va_end(ap)
+#define _PDCLIB_va_start( ap, parmN ) va_start(ap, parmN)
 
 /* -------------------------------------------------------------------------- */
 /* OS "glue", part 1                                                          */