Bug #12 - Documentation for atexit() wrong. Fixed.
Bug #13 - Missing NULL include in strtox_prelim.c. Fixed.
Bug #14 - s / us - unknown suffix. Fixed.
Bug #15 - Wrong macro name "concat". Fixed.
*/
#include <ctype.h>
+#include <stddef.h>
const char * _PDCLIB_strtox_prelim( const char * p, char * sign, int * base )
{
*/
/* Wrapper for _PDCLIB_memswp protects against multiple argument evaluation. */
-static inline void memswp( char * i, char * j, unsigned int size )
+static inline void memswp( char * i, char * j, size_t size )
{
_PDCLIB_memswp( i, j, size );
}
/* Expand to an integer constant of specified value and type int_leastN_t */
-#define INT8_C( value ) concat( value, _PDCLIB_INT8_LITERAL )
-#define INT16_C( value ) concat( value, _PDCLIB_INT16_LITERAL )
-#define INT32_C( value ) concat( value, _PDCLIB_INT32_LITERAL )
-#define INT64_C( value ) concat( value, _PDCLIB_INT64_LITERAL )
+#define INT8_C( value ) value
+#define INT16_C( value ) value
+#define INT32_C( value ) _PDCLIB_concat( value, _PDCLIB_INT32_LITERAL )
+#define INT64_C( value ) _PDCLIB_concat( value, _PDCLIB_INT64_LITERAL )
/* Expand to an integer constant of specified value and type uint_leastN_t */
-#define UINT8_C( value ) concat( value, _PDCLIB_UINT8_LITERAL )
-#define UINT16_C( value ) concat( value, _PDCLIB_UINT16_LITERAL )
-#define UINT32_C( value ) concat( value, _PDCLIB_UINT32_LITERAL )
-#define UINT64_C( value ) concat( value, _PDCLIB_UINT64_LITERAL )
+#define UINT8_C( value ) value
+#define UINT16_C( value ) value
+#define UINT32_C( value ) _PDCLIB_concat( value, _PDCLIB_UINT32_LITERAL )
+#define UINT64_C( value ) _PDCLIB_concat( value, _PDCLIB_UINT64_LITERAL )
/* 7.18.4.2 Macros for greatest-width integer constants */
*/
void abort( void );
-/* Register a function that will be called on exit(), _Exit(), or when main()
- returns. At least 32 functions can be registered this way, and will be
- called in reverse order of registration (last-in, first-out).
+/* Register a function that will be called on exit(), or when main() returns.
+ At least 32 functions can be registered this way, and will be called in
+ reverse order of registration (last-in, first-out).
Returns zero if registration is successfull, nonzero if it failed.
*/
int atexit( void (*func)( void ) );
#define _PDCLIB_INT8_MAX _PDCLIB_CHAR_MAX
#define _PDCLIB_INT8_MIN _PDCLIB_CHAR_MIN
#define _PDCLIB_UINT8_MAX _PDCLIB_UCHAR_MAX
-#define _PDCLIB_INT8_LITERAL
-#define _PDCLIB_UINT8_LITERAL
#else
#error Unsupported width of char (not 8 bits).
#endif
#define _PDCLIB_INT16_MAX _PDCLIB_INT_MAX
#define _PDCLIB_INT16_MIN _PDCLIB_INT_MIN
#define _PDCLIB_UINT16_MAX _PDCLIB_UINT_MAX
-#define _PDCLIB_INT16_LITERAL
-#define _PDCLIB_UINT16_LITERAL
#elif _PDCLIB_SHRT_BYTES == 2
typedef signed short _PDCLIB_int16_t;
typedef unsigned short _PDCLIB_uint16_t;
#define _PDCLIB_INT16_MAX _PDCLIB_SHRT_MAX
#define _PDCLIB_INT16_MIN _PDCLIB_SHRT_MIN
#define _PDCLIB_UINT16_MAX _PDCLIB_USHRT_MAX
-#define _PDCLIB_INT16_LITERAL s
-#define _PDCLIB_UINT16_LITERAL us
#else
#error Neither 'short' nor 'int' are 16-bit.
#endif