fixed sleep, added cross-compile file for windows
Across_file.txt
| @@ -0,0 +1,17 @@ | |||
|---|---|---|---|
| 1 | + | [binaries] | |
| 2 | + | c = '/usr/bin/x86_64-w64-mingw32-gcc' | |
| 3 | + | ar = '/usr/x86_64-w64-mingw32/bin/ar' | |
| 4 | + | strip = '/usr/bin/x86_64-w64-mingw32-strip' | |
| 5 | + | exe_wrapper = 'wine' | |
| 6 | + | ||
| 7 | + | [properties] | |
| 8 | + | ||
| 9 | + | c_args = ['-std=gnu11', '-Wall', '-Wextra', '-Wpedantic'] | |
| 10 | + | c_link_args = [] | |
| 11 | + | needs_exe_wrapper = true | |
| 12 | + | ||
| 13 | + | [host_machine] | |
| 14 | + | system = 'windows' | |
| 15 | + | cpu_family = 'x86_64' | |
| 16 | + | cpu = 'x86_64' | |
| 17 | + | endian = 'little' | |
Minclude/cutils/misc.h
| @@ -10,6 +10,6 @@ | |||
|---|---|---|---|
| 10 | 10 | #include <windows.h> | |
| 11 | 11 | #endif | |
| 12 | 12 | ||
| 13 | - | void sleep_ms(int milliseconds); | |
| 13 | + | void sleep_ms(unsigned int milliseconds); | |
| 14 | 14 | uint32_t ntoh32(uint32_t const net); | |
| 15 | 15 | #endif //MISC_H | |
Mmeson.build
| @@ -1,7 +1,7 @@ | |||
|---|---|---|---|
| 1 | 1 | project('cutils', 'c') | |
| 2 | 2 | ||
| 3 | 3 | WARNINGS = ['-Wall', '-Wpedantic', '-Wextra', '-Wnull-dereference', '-Wshadow', '-Wconversion', '-Wstrict-prototypes', '-Wmissing-prototypes', '-Wcast-qual', '-Wstrict-overflow=5', '-Wunreachable-code', '-Wno-unused-parameter' ] | |
| 4 | - | CFLAGS = ['-std=c11', '-fstrict-aliasing', '-fPIC'] + WARNINGS | |
| 4 | + | CFLAGS = ['-std=gnu11', '-fstrict-aliasing', '-fPIC'] + WARNINGS | |
| 5 | 5 | ||
| 6 | 6 | subdir('include') | |
| 7 | 7 | subdir('src') | |