Land #297, Add recallocarray
This commit is contained in:
@@ -681,6 +681,10 @@ if(NOT HAVE_ASPRINTF)
|
||||
set(EXTRA_EXPORT ${EXTRA_EXPORT} vasprintf)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_GETPAGESIZE)
|
||||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/getpagesize.c)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_INET_PTON)
|
||||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/inet_pton.c)
|
||||
set(EXTRA_EXPORT ${EXTRA_EXPORT} inet_pton)
|
||||
@@ -691,6 +695,11 @@ if(NOT HAVE_REALLOCARRAY)
|
||||
set(EXTRA_EXPORT ${EXTRA_EXPORT} reallocarray)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_RECALLOCARRAY)
|
||||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/recallocarray.c)
|
||||
set(EXTRA_EXPORT ${EXTRA_EXPORT} recallocarray)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_STRCASECMP)
|
||||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strcasecmp.c)
|
||||
set(EXTRA_EXPORT ${EXTRA_EXPORT} strcasecmp)
|
||||
|
@@ -81,6 +81,10 @@ if !HAVE_ASPRINTF
|
||||
libcompat_la_SOURCES += compat/bsd-asprintf.c
|
||||
endif
|
||||
|
||||
if !HAVE_GETPAGESIZE
|
||||
libcompat_la_SOURCES += compat/getpagesize.c
|
||||
endif
|
||||
|
||||
if !HAVE_INET_PTON
|
||||
libcompat_la_SOURCES += compat/inet_pton.c
|
||||
endif
|
||||
@@ -93,6 +97,10 @@ if !HAVE_REALLOCARRAY
|
||||
libcompat_la_SOURCES += compat/reallocarray.c
|
||||
endif
|
||||
|
||||
if !HAVE_RECALLOCARRAY
|
||||
libcompat_la_SOURCES += compat/recallocarray.c
|
||||
endif
|
||||
|
||||
if !HAVE_TIMINGSAFE_MEMCMP
|
||||
libcompat_la_SOURCES += compat/timingsafe_memcmp.c
|
||||
endif
|
||||
|
18
crypto/compat/getpagesize.c
Normal file
18
crypto/compat/getpagesize.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* $OpenBSD$ */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
getpagesize(void) {
|
||||
#ifdef _MSC_VER
|
||||
SYSTEM_INFO system_info;
|
||||
GetSystemInfo(&system_info);
|
||||
return system_info.dwPageSize;
|
||||
#else
|
||||
return sysconf(_SC_PAGESIZE);
|
||||
#endif
|
||||
}
|
Reference in New Issue
Block a user