Skip to content

Commit a5a3b15

Browse files
hannesbraundimensionscape
authored andcommitted
Don't include xlocale.h on Linux without glibc
musl, as on Alpine, has no xlocale.h; newlocale and uselocale come from locale.h on every Linux. HaxeFoundation/hxcpp#1165 Fixes #19
1 parent a67ffed commit a5a3b15

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

‎.github/workflows/main.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,26 @@ jobs:
109109
prepare: /usr/pkg/bin/pkgin -y install neko
110110
run: sh test/regression/run-generated.sh
111111

112+
check-musl:
113+
name: Check Linux with musl
114+
runs-on: ubuntu-latest
115+
steps:
116+
- name: checkout
117+
uses: actions/checkout@v4
118+
119+
- name: setup
120+
uses: ./.github/workflows/setup
121+
with:
122+
haxe: 4.3.7
123+
124+
- name: Generate the regression tests
125+
working-directory: test/regression
126+
run: for test in */; do haxe -C $test build.hxml -D no-compilation -D HXCPP_M64; done
127+
128+
# Alpine packages Neko only in edge so far
129+
- name: Build and run the regression tests on Alpine
130+
run: docker run --rm -v "$PWD:/w" -w /w alpine:edge sh -c "apk add --no-cache neko g++ && sh test/regression/run-generated.sh"
131+
112132
check-haxelib:
113133
name: Check installing with haxelib
114134
strategy:

‎Changes.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ The first libhxcpp version. It is based on hxcpp 4.3 (the changes listed under 4
189189
* Fixed the MSVC setup scripts failing to find Visual Studio installed under a path containing !: delayed expansion dropped the ! from the path vswhere reported (hxcpp #1034)
190190
* Fixed a Raspberry Pi running a 64-bit system building with the 32-bit rpi hardfp profile into bin/RPi: it builds as Linux ARM64 (hxcpp #959)
191191
* Added FreeBSD, OpenBSD and NetBSD hosts: they build with the system clang through the Linux toolchain, into BSD, BSD64 or BSDArm64 (hxcpp #1089)
192+
* Fixed building on Linux with musl, such as Alpine: Sys.cpp included xlocale.h, which musl doesn't have (hxcpp #1165)
192193
* Added the libhxcpp define: a build that uses the library gets -D libhxcpp=<version>. Compare it with version("x.y.z"); a plain string comparison compares text
193194
* Added separate Linux ARMv7 and ARM64 build architectures (hxcpp #1355)
194195
* Fixed AndroidCompat.cpp closing its extern "C" section in the wrong place (hxcpp #1404)

‎src/hx/libs/std/Sys.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include <limits.h>
3434
#ifndef ANDROID
3535
#include <locale.h>
36-
#if !defined(BLACKBERRY) && !defined(EPPC) && !defined(GCW0) && !defined(__GLIBC__) && !defined(NEKO_BSD)
36+
#if !defined(BLACKBERRY) && !defined(EPPC) && !defined(GCW0) && !defined(__GLIBC__) && !defined(__linux__) && !defined(NEKO_BSD)
3737
#include <xlocale.h>
3838
#endif
3939
#endif

0 commit comments

Comments
 (0)