aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/windows/dll/hello-library.cpp
blob: 4cfd7c9c0ad0c25a1d0ee797fa093d4d689afb3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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