1 #ifndef JEMALLOC_INTERNAL_DECLS_H 2 #define JEMALLOC_INTERNAL_DECLS_H 3 4 #include <math.h> 5 #ifdef _WIN32 6 # include <windows.h> 7 # include "msvc_compat/windows_extra.h" 8 9 #else 10 # include <sys/param.h> 11 # include <sys/mman.h> 12 # if !defined(__pnacl__) && !defined(__native_client__) 13 # include <sys/syscall.h> 14 # if !defined(SYS_write) && defined(__NR_write) 15 # define SYS_write __NR_write 16 # endif 17 # include <sys/uio.h> 18 # endif 19 # include <pthread.h> 20 # include <errno.h> 21 # include <sys/time.h> 22 #endif 23 #include <sys/types.h> 24 25 #include <limits.h> 26 #ifndef SIZE_T_MAX 27 # define SIZE_T_MAX SIZE_MAX 28 #endif 29 #include <stdarg.h> 30 #include <stdbool.h> 31 #include <stdio.h> 32 #include <stdlib.h> 33 #include <stdint.h> 34 #include <stddef.h> 35 #ifndef offsetof 36 # define offsetof(type, member) ((size_t)&(((type *)NULL)->member)) 37 #endif 38 #include <string.h> 39 #include <strings.h> 40 #include <ctype.h> 41 #ifdef _MSC_VER 42 # include <io.h> 43 typedef intptr_t ssize_t; 44 # define PATH_MAX 1024 45 # define STDERR_FILENO 2 46 # define __func__ __FUNCTION__ 47 # ifdef JEMALLOC_HAS_RESTRICT 48 # define restrict __restrict 49 # endif 50 /* Disable warnings about deprecated system functions. */ 51 # pragma warning(disable: 4996) 52 #if _MSC_VER < 1800 53 static int isblank(int c)54isblank(int c) 55 { 56 57 return (c == '\t' || c == ' '); 58 } 59 #endif 60 #else 61 # include <unistd.h> 62 #endif 63 #include <fcntl.h> 64 65 #endif /* JEMALLOC_INTERNAL_H */ 66