Skip to content

Put ThreadPool's AtomicInt import before its first class - #497

Merged
dimensionscape merged 2 commits into
mainfrom
feature/adoring-burnell-7378f6
Nov 28, 2026
Merged

dimensionscape merged 2 commits into
mainfrom
feature/adoring-burnell-7378f6

Conversation

@dimensionscape

@dimensionscape dimensionscape commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

For 6.0.3. The C++ build tool (haxe compile-cpp.hxml in tools/hxcpp) has not compiled since 6.0.0. The WorkerExit class that 7c475ba added for the compile threads (#471) went above the #if cpp import cpp.AtomicInt; #end block, and Haxe 4.3.7 refuses an import after a declaration:

tools/hxcpp/ThreadPool.hx:24: characters 1-22 : import and using may not appear after a declaration

The neko build tool never sees that import, so hxcpp.n built, and CI, which builds only hxcpp.n, passed. run.n prefers bin/<host>/BuildTool once someone has built it, so only rebuilding the C++ build tool failed.

The change

  • The import sits with the other imports in ThreadPool.hx.
  • The check-headers job installs Haxe 4.3.7 and type-checks the C++ build tool with haxe -cp tools/hxcpp -main BuildTool -D HXCPP_NEKO_BUILDTOOL=1 -cpp out --no-output, which writes nothing. It fails with the error above on main and passes with the fix.
  • A 6.0.2 Changes.md line.

Tests

Run on Windows x64 with Haxe 4.3.7 and MSVC:

The new CI step has not run yet.

The WorkerExit class that 7c475ba added for the compile threads (#471)
went above the "#if cpp import cpp.AtomicInt; #end" block, and Haxe
refuses an import after a declaration, so haxe compile-cpp.hxml in
tools/hxcpp stopped with "import and using may not appear after a
declaration". The neko build tool never sees that import, so hxcpp.n
built, and CI, which builds only hxcpp.n, passed. run.n prefers
bin/<host>/BuildTool once someone has built it, so only rebuilding the
C++ build tool failed.

The import sits with the others now, and the check-headers job
type-checks the C++ build tool with --no-output, which fails with that
error before this change and passes after it.

Tests: haxe compile-cpp.hxml -D HXCPP_M64 builds
bin/Windows64/BuildTool.exe on Windows x64 with Haxe 4.3.7. Through it,
a small threaded program builds and runs, and
test/compile_errors/check.sh passes, its four builds failing as they
should. The binary was deleted afterwards.
@dimensionscape
dimensionscape force-pushed the feature/adoring-burnell-7378f6 branch from b697389 to 1162606 Compare November 27, 2026 22:06
@dimensionscape
dimensionscape merged commit 7a45d8c into main Nov 28, 2026
4 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant