aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/windows/dll/hello-library.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/windows/dll/hello-library.cpp')
-rw-r--r--examples/windows/dll/hello-library.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/windows/dll/hello-library.cpp b/examples/windows/dll/hello-library.cpp
new file mode 100644
index 0000000000..4cfd7c9c0a
--- /dev/null
+++ b/examples/windows/dll/hello-library.cpp
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <windows.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <time.h>
+
+__declspec(dllexport) char *get_time() {
+ time_t ltime;
+ time(&ltime);
+ return ctime(&ltime);
+}
+
+__declspec(dllexport) void say_hello(char *message) {
+ printf("Hello from dll!\n%s", message);
+}
+
+#ifdef __cplusplus
+}
+#endif
+