From 58afb03f7082b355f2c317c9acb60e48a86d6eec Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 8 Oct 2026 19:22:16 +0000 Subject: Start working on support for compiling on windows using msys2. FossilOrigin-Name: d0b8a592f04b7c438aff01694ef262cef67b71da7625bf7415c1e61ff22d8a63 --- src/os/Makefile.am | 11 +++++++++++ src/os/os.c | 24 ++++++++++++++++++++++++ src/os/os_main.c | 24 ++++++++++++++++++++++++ src/os/windows.c | 25 +++++++++++++++++++++++++ src/os/windows_main.c | 26 ++++++++++++++++++++++++++ 5 files changed, 110 insertions(+) create mode 100644 src/os/Makefile.am create mode 100644 src/os/os.c create mode 100644 src/os/os_main.c create mode 100644 src/os/windows.c create mode 100644 src/os/windows_main.c (limited to 'src/os') diff --git a/src/os/Makefile.am b/src/os/Makefile.am new file mode 100644 index 0000000..46d9edf --- /dev/null +++ b/src/os/Makefile.am @@ -0,0 +1,11 @@ +noinst_LTLIBRARIES = libos.la libosmain.la + +libos_la_SOURCES = src/os/os.c +libos_la_LDFLAGS = -static + +libosmain_la_SOURCES = src/os/os_main.c +libosmain_la_LDFLAGS = -static + +src/os/os.c: src/os/windows.c + +src/os/os_main.c: src/os/windows_main.c diff --git a/src/os/os.c b/src/os/os.c new file mode 100644 index 0000000..2c4fcc6 --- /dev/null +++ b/src/os/os.c @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2026 Peter Mikkelsen + * + * This file is part of aplwc. + * + * Aplwc is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Aplwc is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with aplwc. If not, see . + */ + +#include + +#if OS == OS_Windows +#include "windows.c" +#endif diff --git a/src/os/os_main.c b/src/os/os_main.c new file mode 100644 index 0000000..1d35a78 --- /dev/null +++ b/src/os/os_main.c @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2026 Peter Mikkelsen + * + * This file is part of aplwc. + * + * Aplwc is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Aplwc is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with aplwc. If not, see . + */ + +#include + +#if OS == OS_Windows +#include "windows_main.c" +#endif diff --git a/src/os/windows.c b/src/os/windows.c new file mode 100644 index 0000000..88d8b27 --- /dev/null +++ b/src/os/windows.c @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2026 Peter Mikkelsen + * + * This file is part of aplwc. + * + * Aplwc is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Aplwc is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with aplwc. If not, see . + */ + +#include + +int getline(char **, size_t *, void *) +{ + return -1; +} diff --git a/src/os/windows_main.c b/src/os/windows_main.c new file mode 100644 index 0000000..dc30750 --- /dev/null +++ b/src/os/windows_main.c @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2026 Peter Mikkelsen + * + * This file is part of aplwc. + * + * Aplwc is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Aplwc is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with aplwc. If not, see . + */ + +#include + +int +main(int argc, char **argv) +{ + return portable_main(argc, argv); +} -- cgit v1.2.3