This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cargo build --release --target=aarch64-apple-ios | |
Compiling cc v1.0.25 | |
Compiling pkg-config v0.3.14 | |
Compiling libc v0.2.43 | |
Compiling libz-sys v1.0.21 (file:///Users/jot/libz-sys) | |
error: failed to run custom build command for `libz-sys v1.0.21 (file:///Users/jot/libz-sys)` | |
process didn't exit successfully: `/Users/jot/libz-sys/target/release/build/libz-sys-830cfa7a396b97c0/build-script-build` (exit code: 101) | |
--- stdout | |
cargo:rerun-if-env-changed=LIBZ_SYS_STATIC | |
cargo:rerun-if-changed=build.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cargo build --release --target=armv7-apple-ios | |
Compiling pkg-config v0.3.14 | |
Compiling cc v1.0.25 | |
Compiling libc v0.2.43 | |
Compiling libz-sys v1.0.21 (file:///Users/jot/libz-sys) | |
warning: src/zlib/gzlib.c:214:15: warning: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Wimplicit-function-declaration] | |
warning: (void)snprintf(state->path, len + 1, "%s", (const char *)path); | |
warning: ^ | |
warning: src/zlib/gzlib.c:214:15: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf' | |
warning: 1 warning generated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cargo build --release --target=armv7s-apple-ios | |
Compiling pkg-config v0.3.14 | |
Compiling cc v1.0.25 | |
Compiling libc v0.2.43 | |
Compiling libz-sys v1.0.21 (file:///Users/jot/libz-sys) | |
warning: src/zlib/gzlib.c:214:15: warning: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Wimplicit-function-declaration] | |
warning: (void)snprintf(state->path, len + 1, "%s", (const char *)path); | |
warning: ^ | |
warning: src/zlib/gzlib.c:214:15: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf' | |
warning: 1 warning generated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test.c: | |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
char buf[128] = {0}; | |
printf("TESTING TESTING TESTING\n"); | |
snprintf(buf, 128, "%s", "TESTING TESTING TESTING\n"); | |
printf("%s", buf); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
336 #if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) | |
337 __BEGIN_DECLS | |
338 int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4); | |
339 int vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0); | |
340 int vscanf(const char * __restrict __format, va_list) __scanflike(1, 0); | |
341 int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0); | |
342 int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0); | |
343 __END_DECLS | |
344 #endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/build.rs b/build.rs | |
index c3ac6c6..76ffe9d 100644 | |
--- a/build.rs | |
+++ b/build.rs | |
@@ -104,6 +104,7 @@ fn build_zlib(cfg: &mut cc::Build, target: &str) { | |
cfg.define("STDC", None); | |
cfg.define("_LARGEFILE64_SOURCE", None); | |
cfg.define("_POSIX_SOURCE", None); | |
+ cfg.define("_C99_SOURCE", None); | |
cfg.flag("-fvisibility=hidden"); |