Skip to content

Commit

Permalink
Moving the positioning of sys/types.h to help older darwin builds
Browse files Browse the repository at this point in the history
  • Loading branch information
david-dick committed Jan 6, 2025
1 parent 49dadda commit 14bf8f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion URandom.xs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <sys/types.h>
#ifdef HAVE_CRYPT_URANDOM_NATIVE_GETRANDOM
#include <sys/random.h>
#else
Expand All @@ -21,7 +22,6 @@
#else
#define GRND_NONBLOCK 0x0001
#endif
#include <sys/types.h>
#include <errno.h>

MODULE = Crypt::URandom PACKAGE = Crypt::URandom PREFIX = crypt_urandom_
Expand Down
2 changes: 2 additions & 0 deletions check_random.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ my $binary_name = 'a.out';
my $output = q[];
open FOO, ">$test_file_name" or die "Failed to open $test_file_name for writing:$!";
print FOO <<'_OUT_';
#include <sys/types.h>
#include <sys/random.h>

int main(void)
Expand Down Expand Up @@ -55,6 +56,7 @@ _OUT_
warn_or_diag "SYS_getrandom from sys/syscall is unavailable\n";
open FOO, ">$test_file_name" or die "Failed to open $test_file_name for writing:$!";
print FOO <<'_OUT_';
#include <sys/types.h>
#include <sys/random.h>

int main(void)
Expand Down

0 comments on commit 14bf8f3

Please sign in to comment.