folly: allow folly::init to build on systems without the symbolizer (macOS)
[folly.git] / folly / portability / Stdlib.h
index 2e7c1c0b893c1f83c994a8c00412363ab222f048..4008c088316c4d2d4fe35cd067160ca2081b512a 100644 (file)
 
 #include <cstdlib>
 
-extern int posix_memalign(void** memptr, size_t alignment, size_t size);
+#ifdef _WIN32
+// These are technically supposed to be defined linux/limits.h and
+// sys/param.h respectively, but Windows defines _MAX_PATH in stdlib.h,
+// so, instead of creating two headers for a single define each, we put
+// them here, where they are likely to already have been included in the
+// code that needs them.
+#define PATH_MAX _MAX_PATH
+#define MAXPATHLEN _MAX_PATH
+
+extern "C" {
+char* mktemp(char* tn);
+char* mkdtemp(char* tn);
+int mkstemp(char* tn);
+char* realpath(const char* path, char* resolved_path);
+}
+#endif