mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
CompCert compatibility
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "crypto_auth_hmacsha256.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef crypto_onetimeauth_poly1305_H
|
||||
#define crypto_onetimeauth_poly1305_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#ifndef _WIN32
|
||||
# include <sys/stat.h>
|
||||
@@ -13,7 +14,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifndef _MSC_VER
|
||||
# include <unistd.h>
|
||||
@@ -135,7 +135,9 @@ randombytes_salsa20_random_random_dev_open(void)
|
||||
fd = open(*device, O_RDONLY);
|
||||
if (fd != -1) {
|
||||
if (fstat(fd, &st) == 0 &&
|
||||
# ifdef S_ISNAM
|
||||
# ifdef __COMPCERT__
|
||||
1
|
||||
# elif defined(S_ISNAM)
|
||||
(S_ISNAM(st.st_mode) || S_ISCHR(st.st_mode))
|
||||
# else
|
||||
S_ISCHR(st.st_mode)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#ifndef _WIN32
|
||||
# include <sys/stat.h>
|
||||
@@ -13,7 +14,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifndef _WIN32
|
||||
# include <unistd.h>
|
||||
@@ -120,7 +120,9 @@ randombytes_sysrandom_random_dev_open(void)
|
||||
fd = open(*device, O_RDONLY);
|
||||
if (fd != -1) {
|
||||
if (fstat(fd, &st) == 0 &&
|
||||
# ifdef S_ISNAM
|
||||
# ifdef __COMPCERT__
|
||||
1
|
||||
# elif defined(S_ISNAM)
|
||||
(S_ISNAM(st.st_mode) || S_ISCHR(st.st_mode))
|
||||
# else
|
||||
S_ISCHR(st.st_mode)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
Reference in New Issue
Block a user