summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/examples
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2019-05-13 11:13:55 +0200
committerNeal H. Walfield <neal@pep.foundation>2019-05-13 11:13:55 +0200
commit12b59e857cb64de0e354ca17736dbff2e3b5a6e1 (patch)
tree4ef94c0f57599cc279293c8456b71c39ddc04209 /openpgp-ffi/examples
parent25c309102d81d62a1db439aae4fa7d45a155df6b (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.)
Diffstat (limited to 'openpgp-ffi/examples')
-rw-r--r--openpgp-ffi/examples/decrypt-with.c1
-rw-r--r--openpgp-ffi/examples/encrypt-for.c1
-rw-r--r--openpgp-ffi/examples/generate-key.c1
3 files changed, 3 insertions, 0 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>