diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-05-13 11:13:55 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-05-13 11:13:55 +0200 |
commit | 12b59e857cb64de0e354ca17736dbff2e3b5a6e1 (patch) | |
tree | 4ef94c0f57599cc279293c8456b71c39ddc04209 | |
parent | 25c309102d81d62a1db439aae4fa7d45a155df6b (diff) |
openpgp-ffi: Only include unistd.h when needed
- sequoia/openpgp.h doesn't require <unistd.h> so don't include it
there.
- Several examples do need <unistd.h> for STDIN_FILENO. So, include
it locally.
- Note: <unistd.h> is not available on Windows. This change makes
<sequoia/openpgp.h> work there. (Although the examples now fail.)
-rw-r--r-- | openpgp-ffi/examples/decrypt-with.c | 1 | ||||
-rw-r--r-- | openpgp-ffi/examples/encrypt-for.c | 1 | ||||
-rw-r--r-- | openpgp-ffi/examples/generate-key.c | 1 | ||||
-rw-r--r-- | openpgp-ffi/include/sequoia/openpgp.h | 1 |
4 files changed, 3 insertions, 1 deletions
diff --git a/openpgp-ffi/examples/decrypt-with.c b/openpgp-ffi/examples/decrypt-with.c index 68ef0606..0f2662ab 100644 --- a/openpgp-ffi/examples/decrypt-with.c +++ b/openpgp-ffi/examples/decrypt-with.c @@ -16,6 +16,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include <sequoia/openpgp.h> diff --git a/openpgp-ffi/examples/encrypt-for.c b/openpgp-ffi/examples/encrypt-for.c index de2abd64..e3125dc3 100644 --- a/openpgp-ffi/examples/encrypt-for.c +++ b/openpgp-ffi/examples/encrypt-for.c @@ -15,6 +15,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include <sequoia/openpgp.h> diff --git a/openpgp-ffi/examples/generate-key.c b/openpgp-ffi/examples/generate-key.c index 96a7f2fc..fed2852c 100644 --- a/openpgp-ffi/examples/generate-key.c +++ b/openpgp-ffi/examples/generate-key.c @@ -1,5 +1,6 @@ #include <assert.h> #include <stdio.h> +#include <unistd.h> #include <sequoia/openpgp.h> diff --git a/openpgp-ffi/include/sequoia/openpgp.h b/openpgp-ffi/include/sequoia/openpgp.h index 1e9b7ef6..141b5b7f 100644 --- a/openpgp-ffi/include/sequoia/openpgp.h +++ b/openpgp-ffi/include/sequoia/openpgp.h @@ -5,7 +5,6 @@ #include <stdint.h> #include <stdbool.h> #include <limits.h> -#include <unistd.h> #include <time.h> #include <sequoia/io.h> |