Initial commit
[kaleidoscope.git] / Kaleidoscope / stdlib.cpp
diff --git a/Kaleidoscope/stdlib.cpp b/Kaleidoscope/stdlib.cpp
new file mode 100644 (file)
index 0000000..08ccfd8
--- /dev/null
@@ -0,0 +1,20 @@
+//
+//  stdlib.cpp
+//  Kaleidoscope
+//
+//  Created by Luke Lau on 11/02/2018.
+//  Copyright © 2018 Luke Lau. All rights reserved.
+//
+
+#include "stdlib.hpp"
+
+#ifdef LLVM_ON_WIN32
+#define DLLEXPORT __declspec(dllexport)
+#else
+#define DLLEXPORT
+#endif
+
+extern "C" DLLEXPORT double putchard(double X) {
+       fputc((char)X, stderr);
+       return 0;
+}