dsprenkels / randombytes

A portable C library for generating cypto-secure random bytes
MIT License
96 stars 37 forks source link

Add #define _GNU_SOURCE to randombytes.h #9

Closed dsprenkels closed 6 years ago

dsprenkels commented 6 years ago

On compilation on Linux with the getrandom system call, the compiler throws a warning, because SYS_getrandom is defined implicitly. This was because the #includes in randombytes.h do not set _GNU_SOURCE accordingly. So _GNU_SOURCE is defined after unistd.h is included for the first time.

This PR adds _GNU_SOURCE to randombytes.h to fix this issue.