depot/third_party/nixpkgs/pkgs/os-specific/darwin/cctools/darwin-no-memstream.patch
Default email 92b3d6365d Project import generated by Copybara.
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
2022-10-30 16:09:59 +01:00

21 lines
774 B
Diff

MacOS SDKs before 10.13 don't support open_memstream. This is already replaced
by a runtime check in cctools-port, but because we build with SDK 10.12 by
default, linking still fails for us. Disable it entirely here.
--- a/cctools/include/stuff/diagnostics.h
+++ b/cctools/include/stuff/diagnostics.h
@@ -60,13 +60,6 @@ void diagnostics_log_msg(enum diagnostic_level level, const char* message);
*/
void diagnostics_write(void);
-#if defined(__APPLE__ ) && defined(__has_builtin)
-# if __has_builtin(__builtin_available)
-# define HAVE_OPENMEMSTREAM_RUNTIME __builtin_available(macOS 10.13, *)
-# endif
-#endif
-#ifndef HAVE_OPENMEMSTREAM_RUNTIME
-# define HAVE_OPENMEMSTREAM_RUNTIME 1
-#endif
+#define HAVE_OPENMEMSTREAM_RUNTIME 0
#endif /* diagnostics_h */