aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-09-21 16:21:21 +0000
committerstephan <stephan@noemail.net>2022-09-21 16:21:21 +0000
commit65022716b349c82870f13a9004dc6b1071ddfe7d (patch)
tree6129cf2f891b16076a1635975e3fc5de44c41ebe /src
parente8afca3f16c7c2a68e4f18a615f0efc0d3203c1b (diff)
downloadsqlite-65022716b349c82870f13a9004dc6b1071ddfe7d.tar.gz
sqlite-65022716b349c82870f13a9004dc6b1071ddfe7d.zip
shell.c.in: when building in fiddle mode, define _POSIX_SOURCE (ifndef) so that emcc's string.h reveals strdup().
FossilOrigin-Name: fb85b269c43147f153977606dd8ede7b93744bf955e4c1a2b198907fd8a94620
Diffstat (limited to 'src')
-rw-r--r--src/shell.c.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shell.c.in b/src/shell.c.in
index d6f3a0aeb..bef30f5df 100644
--- a/src/shell.c.in
+++ b/src/shell.c.in
@@ -85,6 +85,14 @@
# define _LARGEFILE_SOURCE 1
#endif
+#if defined(SQLITE_SHELL_FIDDLE) && !defined(_POSIX_SOURCE)
+/*
+** emcc requires _POSIX_SOURCE (or one of several similar defines)
+** to expose strdup().
+*/
+# define _POSIX_SOURCE
+#endif
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>