diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-09-10 17:44:32 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-09-10 17:53:07 +0300 |
commit | f04ab838abd90fb70f7d6ef77fdacdf07f09ba4d (patch) | |
tree | 00d3d7834953f6ca2b7a804fe02bfd95f795c6e6 /compat/pb_syshdr.h | |
parent | e681dd0d75a4b6a7974cc898477f3a138f7872c2 (diff) |
Build fixes for Windows/Visual C++
Diffstat (limited to 'compat/pb_syshdr.h')
-rw-r--r-- | compat/pb_syshdr.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/compat/pb_syshdr.h b/compat/pb_syshdr.h index c170c8de..b69a1671 100644 --- a/compat/pb_syshdr.h +++ b/compat/pb_syshdr.h @@ -12,6 +12,9 @@ #define _PB_SYSHDR_H_ /* stdint.h subset */ +#ifdef HAVE_STDINT_H +#include <stdint.h> +#else /* You will need to modify these to match the word size of your platform. */ typedef signed char int8_t; typedef unsigned char uint8_t; @@ -21,8 +24,13 @@ typedef signed int int32_t; typedef unsigned int uint32_t; typedef signed long long int64_t; typedef unsigned long long uint64_t; +#endif /* stddef.h subset */ +#ifdef HAVE_STDDEF_H +#include <stddef.h> +#else + typedef uint32_t size_t; #define offsetof(st, m) ((size_t)(&((st *)0)->m)) @@ -30,12 +38,26 @@ typedef uint32_t size_t; #define NULL 0 #endif +#endif + /* stdbool.h subset */ +#ifdef HAVE_STDBOOL_H +#include <stdbool.h> +#else + +#ifndef __cplusplus typedef int bool; #define false 0 #define true 1 +#endif + +#endif /* string.h subset */ +#ifdef HAVE_STRING_H +#include <string.h> +#else + /* Implementations are from the Public Domain C Library (PDCLib). */ static size_t strlen( const char * s ) { @@ -67,5 +89,6 @@ static void * memset( void * s, int c, size_t n ) } return s; } +#endif #endif |