diff options
| author | peter <peter@pmikkelsen.com> | 2026-10-08 20:06:01 +0000 |
|---|---|---|
| committer | peter <peter@pmikkelsen.com> | 2026-10-08 20:06:01 +0000 |
| commit | ac434acebb3c01977ad6a7d2ad7507c9909802e0 (patch) | |
| tree | 9d7910cd230ff585ee3c3a474e88f32307536680 | |
| parent | 58afb03f7082b355f2c317c9acb60e48a86d6eec (diff) | |
More work to support building on windows.windows-msys2-support
Right now, the build fails completely, because src/bin/main.c uses some unix specific functionalities. Next up is implementing them in the os/* files, but that won't be today.
FossilOrigin-Name: 91ed737388525736696714b585eb50b423789aab5c1a245fe9269d52be10c8c2
| -rw-r--r-- | configure.ac | 8 | ||||
| -rw-r--r-- | src/bin/aplwc_repl.h | 8 | ||||
| -rw-r--r-- | src/bin/main.c | 4 | ||||
| -rw-r--r-- | src/include/os.h | 2 | ||||
| -rw-r--r-- | src/os/windows.c | 2 |
5 files changed, 8 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac index 86a12b7..ba10bb0 100644 --- a/configure.ac +++ b/configure.ac @@ -35,9 +35,13 @@ AS_CASE([$build_mode], ) AS_CASE([$host_os], - [mingw32], [AC_DEFINE([HOST_OS_WINDOWS], [1], [Host operating system is Windows])]) + [mingw32], [AC_DEFINE([HOST_OS_WINDOWS], [1], [Host operating system is Windows])], + [cygwin], [AC_DEFINE([HOST_OS_WINDOWS], [1], [Host operating system is Windows])] + ) AS_CASE([$build_os], - [mingw32], [AC_DEFINE([BUILD_OS_WINDOWS], [1], [Host operating system is Windows])]) + [mingw32], [AC_DEFINE([BUILD_OS_WINDOWS], [1], [Host operating system is Windows])], + [cygwin], [AC_DEFINE([BUILD_OS_WINDOWS], [1], [Host operating system is Windows])] + ) AC_CONFIG_FILES([ Makefile diff --git a/src/bin/aplwc_repl.h b/src/bin/aplwc_repl.h index 6d01de1..6f93223 100644 --- a/src/bin/aplwc_repl.h +++ b/src/bin/aplwc_repl.h @@ -22,14 +22,6 @@ #include <os.h> #include <os_main.h> - -#include <assert.h> -#include <limits.h> -#include <stdint.h> -#include <stddef.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> #include <aplwc.h> #include <aplwc_macros.h> diff --git a/src/bin/main.c b/src/bin/main.c index 04bb13a..3614053 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -17,10 +17,6 @@ * along with aplwc. If not, see <https://www.gnu.org/licenses/>. */ -#define _POSIX_C_SOURCE 200809L -#include <stdio.h> -#include <unistd.h> -#include <errno.h> #include "aplwc_repl.h" static unsigned long failsim_start; diff --git a/src/include/os.h b/src/include/os.h index a56b79d..440cf3b 100644 --- a/src/include/os.h +++ b/src/include/os.h @@ -49,6 +49,6 @@ enum OS { #include <os/windows.h> #endif -int getline(char **, size_t *, void *); +int getline(char **, size_t *, FILE *); #endif /* OS_H */ diff --git a/src/os/windows.c b/src/os/windows.c index 88d8b27..6835cc2 100644 --- a/src/os/windows.c +++ b/src/os/windows.c @@ -19,7 +19,7 @@ #include <os.h> -int getline(char **, size_t *, void *) +int getline(char **lineptr, size_t *n, FILE *stream) { return -1; } |