1 /* This is an example of a header file for platforms/compilers that do
2 * not come with stdint.h/stddef.h/stdbool.h/string.h. To use it, define
3 * PB_SYSTEM_HEADER as "pb_syshdr.h", including the quotes, and add the
4 * extra folder to your include path.
6 * It is very likely that you will need to customize this file to suit
7 * your platform. For any compiler that supports C99, this file should
18 /* You will need to modify these to match the word size of your platform. */
19 typedef signed char int8_t;
20 typedef unsigned char uint8_t;
21 typedef signed short int16_t;
22 typedef unsigned short uint16_t;
23 typedef signed int int32_t;
24 typedef unsigned int uint32_t;
25 typedef signed long long int64_t;
26 typedef unsigned long long uint64_t;
34 typedef uint32_t size_t;
35 #define offsetof(st, m) ((size_t)(&((st *)0)->m))
43 /* stdbool.h subset */
57 #ifdef PB_ENABLE_MALLOC
61 void *realloc(void *ptr, size_t size);
71 /* Implementations are from the Public Domain C Library (PDCLib). */
72 static size_t strlen( const char * s )
82 static void * memcpy( void *s1, const void *s2, size_t n )
84 char * dest = (char *) s1;
85 const char * src = (const char *) s2;
93 static void * memset( void * s, int c, size_t n )
95 unsigned char * p = (unsigned char *) s;
98 *p++ = (unsigned char) c;