Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
013f2ad
add mac
PieterVdc Feb 15, 2026
8909f7f
.
PieterVdc Feb 15, 2026
302feef
Update linux.mk
PieterVdc Feb 15, 2026
8ebe9a6
Update linux.mk
PieterVdc Feb 15, 2026
0c69cab
Update linux.mk
PieterVdc Feb 15, 2026
26ded90
Update linux.mk
PieterVdc Feb 15, 2026
154ac6d
clang
PieterVdc Feb 15, 2026
af2168f
Update linux.mk
PieterVdc Feb 15, 2026
5567c66
Update bflib_cpu.c
PieterVdc Feb 15, 2026
be450a1
Update config.c
PieterVdc Feb 15, 2026
24a5c86
no Werror
PieterVdc Feb 15, 2026
d0fa16c
Update pre_inc.h
PieterVdc Feb 15, 2026
4f59317
Update config.c
PieterVdc Feb 15, 2026
b9d10e9
brackets
PieterVdc Feb 15, 2026
c99fabc
not just linux is posix
PieterVdc Feb 15, 2026
4b805a2
Update linux.mk
PieterVdc Feb 15, 2026
5691574
Update bflib_crash.c
PieterVdc Feb 15, 2026
afe52e1
Update bflib_vidraw.h
PieterVdc Feb 15, 2026
24a5957
Update linux.mk
PieterVdc Feb 15, 2026
a34f3a2
Update linux.mk
PieterVdc Feb 15, 2026
25f335a
Update linux.mk
PieterVdc Feb 15, 2026
565582b
Update linux.mk
PieterVdc Feb 15, 2026
a043694
gcc
PieterVdc Feb 15, 2026
c154cc1
remove packing on some stuff
PieterVdc Feb 15, 2026
cad551d
less packing still
PieterVdc Feb 15, 2026
673ba50
use .app
PieterVdc Feb 15, 2026
b789030
Update macos_bundle.sh
PieterVdc Feb 15, 2026
118427e
Update build-prototype.yml
PieterVdc Feb 15, 2026
669ceee
Merge branch 'master' into mac_ci
PieterVdc Feb 21, 2026
3f5f064
Update build-prototype.yml
PieterVdc Feb 21, 2026
7951e39
Apply suggestion from @Copilot
PieterVdc Mar 2, 2026
7a81dc6
Merge remote-tracking branch 'upstream/master' into mac_ci
PieterVdc Mar 2, 2026
b738d4c
_XOPEN_SOURCE
PieterVdc Mar 2, 2026
ef678ab
Update bflib_crash.c
PieterVdc Mar 2, 2026
b77aadd
Update bflib_crash.c
PieterVdc Mar 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/build-prototype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,59 @@ jobs:
with:
name: ${{ env.LINUX_ARTIFACT_NAME }}
path: bin/keeperfx

build-prototype-macos:
name: "Build Prototype macOS arm64"
runs-on: macos-14

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Update system
run: |
set -eux
brew update
brew install \
cmake \
gcc \
pkg-config \
sdl2 \
sdl2_image \
sdl2_mixer \
sdl2_net \
ffmpeg \
openal-soft \
luajit \
libspng \
minizip \
zlib \
miniupnpc \
libnatpmp

- name: Build
run: |
set -eux
GCC_MAJOR=$(brew list --versions gcc | awk '{print $2}' | cut -d. -f1)
BUILD_NUMBER=$(git rev-list --count origin/master)
GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)
PACKAGE_SUFFIX=Prototype_$(git rev-parse --short=7 "$GITHUB_SHA")
make BUILD_NUMBER=$BUILD_NUMBER VER_SUFFIX=$PACKAGE_SUFFIX PLATFORM=mac ARCH=arm64 CC=gcc-$GCC_MAJOR CXX=g++-$GCC_MAJOR -f linux.mk

- name: Bundle app
run: |
set -eux
chmod +x tools/macos_bundle.sh
APP_NAME=KeeperFX.app OUTPUT_DIR=dist BIN_PATH=bin/keeperfx tools/macos_bundle.sh

- name: Package app
run: |
set -eux
ditto -c -k --keepParent dist/KeeperFX.app dist/KeeperFX.app.zip

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: keeperfx-macos-app
path: dist/KeeperFX.app.zip
244 changes: 213 additions & 31 deletions linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,81 @@ STRIP ?= strip
ECHO ?= echo
MV ?= mv -f

PLATFORM ?= $(shell uname -s)
ARCH ?= $(shell uname -m)

ifeq ($(PLATFORM),Linux)
PLATFORM := linux
endif
ifeq ($(PLATFORM),Darwin)
PLATFORM := mac
endif
ifeq ($(PLATFORM),macos)
PLATFORM := mac
endif

ifeq ($(ARCH),amd64)
ARCH := x86_64
endif
ifeq ($(ARCH),aarch64)
ARCH := arm64
endif

DEPS_ASTRONOMY_TAG ?= 20250418
DEPS_CENTIJSON_TAG ?= 20250418
DEPS_ENET6_TAG ?= 20260213
DEPS_ASTRONOMY_REPO ?= https://github.com/cosinekitty/astronomy.git
DEPS_CENTIJSON_REPO ?= https://github.com/mity/centijson.git
DEPS_ENET6_REPO ?= https://github.com/SirLynix/enet6.git
DEPS_ASTRONOMY_REF ?=
DEPS_CENTIJSON_REF ?=
DEPS_ENET6_REF ?=
DEPS_CLONE_DEPTH ?= 1
DEPS_BUILD_DIR ?= deps/_build
DEPS_SUFFIX ?=
DEPS_DOWNLOAD ?= 1

ifeq ($(PLATFORM),linux)
ifeq ($(ARCH),x86_64)
DEPS_SUFFIX ?= lin64
else
# No prebuilt dependency archive defined for this architecture; disable downloads.
DEPS_DOWNLOAD ?= 0
endif
endif
Comment thread
PieterVdc marked this conversation as resolved.
ifeq ($(PLATFORM),mac)
DEPS_DOWNLOAD ?= 0
endif

ifeq ($(PLATFORM),linux)
ifeq ($(ARCH),x86_64)
ARCH_CFLAGS := -march=x86-64
else ifeq ($(ARCH),arm64)
ARCH_CFLAGS := -march=armv8-a
else
$(error Unsupported ARCH for linux: $(ARCH))
endif
ARCH_LDFLAGS :=
else ifeq ($(PLATFORM),mac)
ifeq ($(ARCH),x86_64)
ARCH_CFLAGS := -arch x86_64
else ifeq ($(ARCH),arm64)
ARCH_CFLAGS := -arch arm64
else
$(error Unsupported ARCH for mac: $(ARCH))
endif
ARCH_LDFLAGS := $(ARCH_CFLAGS)
else
$(error Unsupported PLATFORM: $(PLATFORM))
endif

WARN_NO_FORMAT_TRUNCATION :=
ifeq ($(PLATFORM),linux)
WARN_NO_FORMAT_TRUNCATION := -Wno-format-truncation
endif

CXX_STD ?= -std=c++17

KFX_SOURCES = \
src/actionpt.c \
src/api.c \
Expand Down Expand Up @@ -282,35 +357,63 @@ KFX_INCLUDES = \
-Ideps/centitoml \
-Ideps/astronomy/include \
-Ideps/enet6/include \
$(shell pkg-config --cflags-only-I sdl2) \
$(shell pkg-config --cflags-only-I SDL2_image) \
$(shell pkg-config --cflags-only-I SDL2_mixer) \
$(shell pkg-config --cflags-only-I SDL2_net) \
$(shell pkg-config --cflags-only-I libavformat) \
$(shell pkg-config --cflags-only-I libavcodec) \
$(shell pkg-config --cflags-only-I libswresample) \
$(shell pkg-config --cflags-only-I libavutil) \
$(shell pkg-config --cflags-only-I openal) \
$(shell pkg-config --cflags-only-I openal-soft) \
$(shell pkg-config --cflags-only-I spng) \
$(shell pkg-config --cflags-only-I minizip) \
$(shell pkg-config --cflags-only-I zlib) \
$(shell pkg-config --cflags-only-I luajit)

KFX_CFLAGS += -g -DDEBUG -DBFDEBUG_LEVEL=0 -O3 -march=x86-64 $(KFX_INCLUDES) -Wall -Wextra -Werror -Wno-unused-parameter -Wno-absolute-value -Wno-unknown-pragmas -Wno-format-truncation -Wno-sign-compare
KFX_CXXFLAGS += -g -DDEBUG -DBFDEBUG_LEVEL=0 -O3 -march=x86-64 $(KFX_INCLUDES) -Wall -Wextra -Werror -Wno-unused-parameter -Wno-unknown-pragmas -Wno-format-truncation -Wno-sign-compare
ifeq ($(PLATFORM),mac)
KFX_INCLUDES += \
-I/opt/homebrew/opt/openal-soft/include \
-I/usr/local/opt/openal-soft/include
endif

KFX_CFLAGS += -g -DDEBUG -DBFDEBUG_LEVEL=0 -O3 $(ARCH_CFLAGS) $(KFX_INCLUDES) -Wall -Wextra -Wno-unused-parameter -Wno-absolute-value -Wno-unknown-pragmas $(WARN_NO_FORMAT_TRUNCATION) -Wno-sign-compare -fsigned-char
KFX_CXXFLAGS += -g -DDEBUG -DBFDEBUG_LEVEL=0 -O3 $(CXX_STD) $(ARCH_CFLAGS) $(KFX_INCLUDES) -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas $(WARN_NO_FORMAT_TRUNCATION) -Wno-sign-compare -fsigned-char

KFX_LDFLAGS += \
-g \
-rdynamic \
-Wall -Wextra -Werror \
$(ARCH_LDFLAGS) \
-Ldeps/astronomy -lastronomy \
-Ldeps/centijson -ljson \
-Ldeps/enet6 -lenet6 \
$(shell pkg-config --libs-only-l sdl2) \
$(shell pkg-config --libs-only-l SDL2_mixer) \
$(shell pkg-config --libs-only-l SDL2_net) \
$(shell pkg-config --libs-only-l SDL2_image) \
$(shell pkg-config --libs-only-l libavformat) \
$(shell pkg-config --libs-only-l libavcodec) \
$(shell pkg-config --libs-only-l libswresample) \
$(shell pkg-config --libs-only-l libavutil) \
$(shell pkg-config --libs-only-l openal) \
$(shell pkg-config --libs-only-l luajit) \
$(shell pkg-config --libs-only-l spng) \
$(shell pkg-config --libs-only-l minizip) \
$(shell pkg-config --libs-only-l zlib) \
$(shell pkg-config --libs sdl2) \
$(shell pkg-config --libs SDL2_mixer) \
$(shell pkg-config --libs SDL2_net) \
$(shell pkg-config --libs SDL2_image) \
$(shell pkg-config --libs libavformat) \
$(shell pkg-config --libs libavcodec) \
$(shell pkg-config --libs libswresample) \
$(shell pkg-config --libs libavutil) \
$(shell pkg-config --libs openal) \
$(shell pkg-config --libs openal-soft) \
$(shell pkg-config --libs luajit) \
$(shell pkg-config --libs spng) \
$(shell pkg-config --libs minizip) \
$(shell pkg-config --libs zlib) \
-lminiupnpc \
-lnatpmp \
-ldl

ifeq ($(PLATFORM),mac)
KFX_LDFLAGS += \
-L/opt/homebrew/opt/openal-soft/lib \
-L/usr/local/opt/openal-soft/lib \
-lopenal
endif

TOML_SOURCES = \
deps/centitoml/toml_api.c

Expand All @@ -319,7 +422,7 @@ TOML_OBJECTS = $(patsubst deps/centitoml/%.c,obj/centitoml/%.o,$(TOML_SOURCES))
TOML_INCLUDES = \
-Ideps/centijson/include

TOML_CFLAGS += -O3 -march=x86-64 $(TOML_INCLUDES) -Wall -Wextra -Werror -Wno-unused-parameter
TOML_CFLAGS += -O3 $(ARCH_CFLAGS) $(TOML_INCLUDES) -Wall -Wextra -Werror -Wno-unused-parameter

ifeq ($(ENABLE_LTO), 1)
KFX_CFLAGS += -flto
Expand Down Expand Up @@ -359,23 +462,102 @@ src/moonphase.c: deps/astronomy/include/astronomy.h
deps/centitoml/toml_api.c: deps/centijson/include/json.h
deps/centitoml/toml_conv.c: deps/centijson/include/json.h

deps/astronomy-lin64.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/20250418/astronomy-lin64.tar.gz"

deps/astronomy/include/astronomy.h: deps/astronomy-lin64.tar.gz | deps/astronomy
tar xzmf $< -C deps/astronomy

deps/centijson-lin64.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/20250418/centijson-lin64.tar.gz"

deps/centijson/include/json.h: deps/centijson-lin64.tar.gz | deps/centijson
tar xzmf $< -C deps/centijson
deps/astronomy/include/astronomy.h: | deps/astronomy
@set -eux; \
if [ -f "$@" ]; then exit 0; fi; \
if [ "$(DEPS_DOWNLOAD)" = "1" ] && [ -n "$(DEPS_SUFFIX)" ]; then \
if [ ! -f "deps/astronomy-$(DEPS_SUFFIX).tar.gz" ]; then \
curl -Lfso "deps/astronomy-$(DEPS_SUFFIX).tar.gz" \
"https://github.com/dkfans/kfx-deps/releases/download/$(DEPS_ASTRONOMY_TAG)/astronomy-$(DEPS_SUFFIX).tar.gz"; \
fi; \
if [ -f "deps/astronomy-$(DEPS_SUFFIX).tar.gz" ]; then \
tar xzmf "deps/astronomy-$(DEPS_SUFFIX).tar.gz" -C deps/astronomy; \
exit 0; \
fi; \
fi; \
rm -rf "$(DEPS_BUILD_DIR)/astronomy"; \
$(MKDIR) "$(DEPS_BUILD_DIR)"; \
git clone --depth "$(DEPS_CLONE_DEPTH)" "$(DEPS_ASTRONOMY_REPO)" "$(DEPS_BUILD_DIR)/astronomy"; \
if [ -n "$(DEPS_ASTRONOMY_REF)" ]; then git -C "$(DEPS_BUILD_DIR)/astronomy" checkout "$(DEPS_ASTRONOMY_REF)"; fi; \
Comment on lines +480 to +481
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git clone step for $(DEPS_ASTRONOMY_REPO) fetches an external repository without pinning to an immutable commit or verifying integrity. If that upstream repo or the network path is compromised, an attacker could inject malicious code into the built binary simply by changing the remote default branch. Pin this dependency to a specific commit (and/or vendor it) and add checksum or signature verification for downloaded sources to prevent supply chain compromise.

Copilot uses AI. Check for mistakes.
if [ -f "$(DEPS_BUILD_DIR)/astronomy/CMakeLists.txt" ]; then \
cmake -S "$(DEPS_BUILD_DIR)/astronomy" -B "$(DEPS_BUILD_DIR)/astronomy/build" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release; \
cmake --build "$(DEPS_BUILD_DIR)/astronomy/build"; \
else \
astro_src=$$(find "$(DEPS_BUILD_DIR)/astronomy" -path "*/source/c/astronomy.c" | head -n 1); \
if [ -z "$$astro_src" ]; then astro_src=$$(find "$(DEPS_BUILD_DIR)/astronomy" -path "*/source/astronomy.c" | head -n 1); fi; \
if [ -z "$$astro_src" ]; then astro_src=$$(find "$(DEPS_BUILD_DIR)/astronomy" -path "*/src/astronomy.c" | head -n 1); fi; \
if [ -z "$$astro_src" ]; then echo "astronomy.c not found"; exit 1; fi; \
astro_inc=$$(find "$(DEPS_BUILD_DIR)/astronomy" -path "*/source/c/astronomy.h" -exec dirname {} \; | head -n 1); \
if [ -z "$$astro_inc" ]; then astro_inc=$$(find "$(DEPS_BUILD_DIR)/astronomy" -path "*/source/astronomy.h" -exec dirname {} \; | head -n 1); fi; \
if [ -z "$$astro_inc" ]; then astro_inc=$$(find "$(DEPS_BUILD_DIR)/astronomy" -path "*/src/astronomy.h" -exec dirname {} \; | head -n 1); fi; \
if [ -z "$$astro_inc" ]; then echo "astronomy.h not found"; exit 1; fi; \
$(MKDIR) "$(DEPS_BUILD_DIR)/astronomy/build"; \
$(CC) -O3 -I"$$astro_inc" -c "$$astro_src" -o "$(DEPS_BUILD_DIR)/astronomy/build/astronomy.o"; \
ar rcs "$(DEPS_BUILD_DIR)/astronomy/build/libastronomy.a" "$(DEPS_BUILD_DIR)/astronomy/build/astronomy.o"; \
fi; \
$(MKDIR) deps/astronomy/include; \
header_path=$$(find "$(DEPS_BUILD_DIR)/astronomy" -name astronomy.h | head -n 1); \
lib_path=$$(find "$(DEPS_BUILD_DIR)/astronomy" -name libastronomy.a | head -n 1); \
if [ -z "$$header_path" ] || [ -z "$$lib_path" ]; then echo "astronomy build output not found"; exit 1; fi; \
cp "$$header_path" deps/astronomy/include/; \
cp "$$lib_path" deps/astronomy/libastronomy.a

deps/enet6-lin64.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/20260213/enet6-lin64.tar.gz"
deps/centijson/include/json.h: | deps/centijson
@set -eux; \
if [ -f "$@" ]; then exit 0; fi; \
if [ "$(DEPS_DOWNLOAD)" = "1" ] && [ -n "$(DEPS_SUFFIX)" ]; then \
if [ ! -f "deps/centijson-$(DEPS_SUFFIX).tar.gz" ]; then \
curl -Lfso "deps/centijson-$(DEPS_SUFFIX).tar.gz" \
"https://github.com/dkfans/kfx-deps/releases/download/$(DEPS_CENTIJSON_TAG)/centijson-$(DEPS_SUFFIX).tar.gz"; \
fi; \
if [ -f "deps/centijson-$(DEPS_SUFFIX).tar.gz" ]; then \
tar xzmf "deps/centijson-$(DEPS_SUFFIX).tar.gz" -C deps/centijson; \
exit 0; \
fi; \
fi; \
rm -rf "$(DEPS_BUILD_DIR)/centijson"; \
$(MKDIR) "$(DEPS_BUILD_DIR)"; \
git clone --depth "$(DEPS_CLONE_DEPTH)" "$(DEPS_CENTIJSON_REPO)" "$(DEPS_BUILD_DIR)/centijson"; \
if [ -n "$(DEPS_CENTIJSON_REF)" ]; then git -C "$(DEPS_BUILD_DIR)/centijson" checkout "$(DEPS_CENTIJSON_REF)"; fi; \
Comment on lines +520 to +521
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git clone step for $(DEPS_CENTIJSON_REPO) pulls code from a third-party GitHub repository without locking to a specific commit or validating integrity. A compromise or malicious update on that remote could silently change what is built here, allowing injected code to run whenever the resulting binary is executed. Pin this dependency to an immutable revision and/or verify checksums or signatures of the fetched sources to harden the build against supply chain attacks.

Copilot uses AI. Check for mistakes.
if [ "$(PLATFORM)" = "mac" ]; then \
find "$(DEPS_BUILD_DIR)/centijson" -name "*.c" -print0 | xargs -0 perl -pi -e 's@#include <malloc.h>@#include <stdlib.h>@'; \
fi; \
cmake -S "$(DEPS_BUILD_DIR)/centijson" -B "$(DEPS_BUILD_DIR)/centijson/build" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release; \
cmake --build "$(DEPS_BUILD_DIR)/centijson/build"; \
$(MKDIR) deps/centijson/include; \
header_path=$$(find "$(DEPS_BUILD_DIR)/centijson" \( -name value.h -o -name json.h \) | head -n 1); \
header_dir=$$(dirname "$$header_path"); \
lib_path=$$(find "$(DEPS_BUILD_DIR)/centijson" \( -name libjson.a -o -name libcentijson.a \) | head -n 1); \
if [ -z "$$header_path" ] || [ -z "$$lib_path" ]; then echo "centijson build output not found"; exit 1; fi; \
cp "$$header_dir"/*.h deps/centijson/include/; \
cp "$$lib_path" deps/centijson/libjson.a

deps/enet6/include/enet6/enet.h: deps/enet6-lin64.tar.gz | deps/enet6
tar xzmf $< -C deps/enet6
deps/enet6/include/enet6/enet.h: | deps/enet6
@set -eux; \
if [ -f "$@" ]; then exit 0; fi; \
if [ "$(DEPS_DOWNLOAD)" = "1" ] && [ -n "$(DEPS_SUFFIX)" ]; then \
if [ ! -f "deps/enet6-$(DEPS_SUFFIX).tar.gz" ]; then \
curl -Lfso "deps/enet6-$(DEPS_SUFFIX).tar.gz" \
"https://github.com/dkfans/kfx-deps/releases/download/$(DEPS_ENET6_TAG)/enet6-$(DEPS_SUFFIX).tar.gz"; \
fi; \
if [ -f "deps/enet6-$(DEPS_SUFFIX).tar.gz" ]; then \
tar xzmf "deps/enet6-$(DEPS_SUFFIX).tar.gz" -C deps/enet6; \
exit 0; \
fi; \
fi; \
rm -rf "$(DEPS_BUILD_DIR)/enet6"; \
$(MKDIR) "$(DEPS_BUILD_DIR)"; \
git clone --depth "$(DEPS_CLONE_DEPTH)" "$(DEPS_ENET6_REPO)" "$(DEPS_BUILD_DIR)/enet6"; \
if [ -n "$(DEPS_ENET6_REF)" ]; then git -C "$(DEPS_BUILD_DIR)/enet6" checkout "$(DEPS_ENET6_REF)"; fi; \
Comment on lines +550 to +551
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git clone for $(DEPS_ENET6_REPO) similarly fetches code from an external repository without commit pinning or integrity checks. This allows any change on the remote default branch (including by an attacker who compromises that repo) to alter the code linked into your binary without changes in this repo. Pin to a specific commit or release and add checksum/signature verification for the downloaded sources to mitigate this supply chain risk.

Copilot uses AI. Check for mistakes.
cmake -S "$(DEPS_BUILD_DIR)/enet6" -B "$(DEPS_BUILD_DIR)/enet6/build" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release; \
cmake --build "$(DEPS_BUILD_DIR)/enet6/build"; \
$(MKDIR) deps/enet6/include/enet6; \
header_path=$$(find "$(DEPS_BUILD_DIR)/enet6" -path "*/enet6/enet.h" | head -n 1); \
lib_path=$$(find "$(DEPS_BUILD_DIR)/enet6" \( -name libenet6.a -o -name libenet.a \) | head -n 1); \
if [ -z "$$header_path" ] || [ -z "$$lib_path" ]; then echo "enet6 build output not found"; exit 1; fi; \
header_dir=$$(dirname "$$header_path"); \
cp "$$header_dir"/*.h deps/enet6/include/enet6/; \
cp "$$lib_path" deps/enet6/libenet6.a

src/ver_defs.h: version.mk
$(ECHO) "#define VER_MAJOR $(VER_MAJOR)" > $@.swp
Expand Down
3 changes: 0 additions & 3 deletions src/ariadne.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,9 +1614,7 @@ TbBool triangle_check_and_add_navitree_bak(long ttri)
ERRORLOG("invalid triangle received");
return false;
}
long n;
long nskipped;
n = 0;
nskipped = 0;
long i;
long k;
Expand Down Expand Up @@ -1644,7 +1642,6 @@ TbBool triangle_check_and_add_navitree_bak(long ttri)
}
}
}
n++;
}
if (nskipped != 0) {
NAVIDBG(6,"navigate heap full, %ld points ignored",nskipped);
Expand Down
6 changes: 2 additions & 4 deletions src/bflib_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,24 @@ extern "C" {
#endif
/******************************************************************************/

#if defined(__i386__) || defined(__x86_64__)
/** Issue a single request to CPUID.
* Fits 'intel features', for instance note that even if only "eax" and "edx"
* are of interest, other registers will be modified by the operation,
* so we need to tell the compiler about it.
*/
static inline void cpuid(int code, uint32_t *a, uint32_t *d) {
#if defined(__i386__) || defined(__x86_64__)
asm volatile("cpuid":"=a"(*a),"=d"(*d):"0"(code):"ecx","ebx");
#endif
}

/** Issue a complete request, storing general registers output in an array.
*/
static inline void cpuid_string(int code, void * destination) {
#if defined(__i386__) || defined(__x86_64__)
uint32_t * where = (uint32_t *) destination;
asm volatile("cpuid":"=a"(*where),"=b"(*(where+1)),
"=c"(*(where+2)),"=d"(*(where+3)):"0"(code));
#endif
}
#endif
/******************************************************************************/

void cpu_detect(struct CPU_INFO *cpu)
Expand Down
Loading