From 0d73f8bc5f6a9e83669721c32eac33b0bf72873d Mon Sep 17 00:00:00 2001 From: avanspector Date: Tue, 14 May 2024 23:54:00 +0200 Subject: [PATCH] add native win32 build all regression tests are passed --- build.bat | 28 ++++++++++++++++++++++++++++ src/file.c | 4 +++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 build.bat diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..ac98444 --- /dev/null +++ b/build.bat @@ -0,0 +1,28 @@ +@echo off +setlocal EnableDelayedExpansion + +if "where /q cl.exe" neq 0 ( + set __VSCMD_ARG_NO_LOGO=1 + for /f "tokens=*" %%i in ('"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath') do set VS=%%i + if "!VS!" equ "" ( + echo ERROR: Visual Studio installation not found + exit /b 1 + ) + call "!VS!\VC\Auxiliary\Build\vcvarsall.bat" amd64 || exit /b 1 +) + +set SRCS=src/args.c ^ + src/avra.c ^ + src/coff.c ^ + src/device.c ^ + src/directiv.c ^ + src/expr.c ^ + src/file.c ^ + src/macro.c ^ + src/map.c ^ + src/mnemonic.c ^ + src/parser.c ^ + src/stdextra.c + +call cl /O2 /MT /nologo %SRCS% /link /out:avra.exe +del *.obj diff --git a/src/file.c b/src/file.c index 364ac8a..255d94a 100644 --- a/src/file.c +++ b/src/file.c @@ -29,8 +29,10 @@ #include #include #include -#include +#ifndef _MSC_VER +#include +#endif #include "misc.h" #include "avra.h"