5fae7dc1b3
Create and use FMT* macros that are equivalent to the PRI* macros that inttypes.h defines. This allows uniform use of the Unix-specific format specifiers, e.g. "%zu", as well as avoiding Windows-specific definitions of e.g. PRIu64. Add ffs()/ffsl() support for compiling with gcc. Extract compatibility definitions of ENOENT, EINVAL, EAGAIN, EPERM, ENOMEM, and ENORANGE into include/msvc_compat/windows_extra.h and use the file for tests as well as for core jemalloc code.
27 lines
529 B
C
27 lines
529 B
C
#ifndef MSVC_COMPAT_WINDOWS_EXTRA_H
|
|
#define MSVC_COMPAT_WINDOWS_EXTRA_H
|
|
|
|
#ifndef ENOENT
|
|
# define ENOENT ERROR_PATH_NOT_FOUND
|
|
#endif
|
|
#ifndef EINVAL
|
|
# define EINVAL ERROR_BAD_ARGUMENTS
|
|
#endif
|
|
#ifndef EAGAIN
|
|
# define EAGAIN ERROR_OUTOFMEMORY
|
|
#endif
|
|
#ifndef EPERM
|
|
# define EPERM ERROR_WRITE_FAULT
|
|
#endif
|
|
#ifndef EFAULT
|
|
# define EFAULT ERROR_INVALID_ADDRESS
|
|
#endif
|
|
#ifndef ENOMEM
|
|
# define ENOMEM ERROR_NOT_ENOUGH_MEMORY
|
|
#endif
|
|
#ifndef ERANGE
|
|
# define ERANGE ERROR_INVALID_DATA
|
|
#endif
|
|
|
|
#endif /* MSVC_COMPAT_WINDOWS_EXTRA_H */
|