Skip to content

Einstein: port to FreeBSD#208

Open
LaurentChardon wants to merge 1 commit into
pguyot:masterfrom
LaurentChardon:master
Open

Einstein: port to FreeBSD#208
LaurentChardon wants to merge 1 commit into
pguyot:masterfrom
LaurentChardon:master

Conversation

@LaurentChardon

@LaurentChardon LaurentChardon commented Feb 28, 2026

Copy link
Copy Markdown

Port Einstein to FreeBSD
While there, handle NetBSD
Don't break existing Linux and OpenBSD

Summary by CodeRabbit

  • Bug Fixes
    • Improved PulseAudio-backed sound output by buffering audio and scheduling writes more reliably.
  • Chores
    • Enhanced cross-platform BSD handling in the build system with more accurate system detection and consistent source/dependency selection across BSD variants.
    • Updated GNU compiler warning flag behavior and expanded clang-format discovery to support additional versions.

Greptile Summary

This PR ports the CMake build paths toward FreeBSD and NetBSD support. The main changes are:

  • FreeBSD and NetBSD system-name handling in the top-level build.
  • BSD source selection for native calls, serial, and PulseAudio sound.
  • BSD dependency lookup for ffi, PulseAudio, and X11.
  • Compiler warning and clang-format discovery updates.

Confidence Score: 4/5

This should be fixed before merging.

  • Mixed C/C++ compiler builds can still pass a GCC-only warning flag to Clang C++ targets.
  • FreeBSD and NetBSD builds still receive the Linux platform macro and can take Linux-only header paths.

CMakeLists.txt

Important Files Changed

Filename Overview
CMakeLists.txt Updates the main platform branch, dependency lookup, compiler flags, and formatter discovery.
Emulator/NativeCalls/CMakeLists.txt Expands native-call source selection from OpenBSD to BSD variants.
Emulator/Serial/CMakeLists.txt Expands serial source selection from OpenBSD to BSD variants.
Emulator/Sound/CMakeLists.txt Expands PulseAudio sound source selection from OpenBSD to BSD variants.

Reviews (3): Last reviewed commit: "Einstein: port to FreeBSD" | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

Port Einstein to FreeBSD
While there, handle NetBSD
Don't break existing Linux and OpenBSD
@coderabbitai

coderabbitai Bot commented Feb 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR broadens BSD platform detection from OpenBSD-specific checks to all BSD variants across CMake build paths, including dependency discovery and source selection. It also changes PulseAudio playback to buffered callback-driven output, synchronizes output state, adjusts GNU compiler warnings, and adds clang-format19 discovery.

Changes

Platform portability and audio output

Layer / File(s) Summary
BSD platform and dependency handling
CMakeLists.txt, Emulator/NativeCalls/CMakeLists.txt, Emulator/Serial/CMakeLists.txt, Emulator/Sound/CMakeLists.txt
Adds FreeBSD/NetBSD handling, broadens BSD conditionals, applies BSD-wide dependency and source selection, restricts warning suppression to GNU compilers, and adds clang-format19 discovery.
Buffered PulseAudio output
Emulator/Sound/TPulseAudioSoundManager.h, Emulator/Sound/TPulseAudioSoundManager.cpp
Adds a ring buffer and synchronized output state, registers a PulseAudio write callback, queues writes through buffered output, requests additional output when needed, and expands teardown cleanup.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Emulator
  participant TPulseAudioSoundManager
  participant TCircleBuffer
  participant PulseAudio
  Emulator->>TPulseAudioSoundManager: ScheduleOutput(audio data)
  TPulseAudioSoundManager->>TCircleBuffer: buffer audio bytes
  PulseAudio->>TPulseAudioSoundManager: PAStreamWriteCallback(requested bytes)
  TPulseAudioSoundManager->>TCircleBuffer: consume queued bytes
  TPulseAudioSoundManager->>PulseAudio: pa_stream_write(buffered bytes)
  PulseAudio->>TPulseAudioSoundManager: underflow notification
  TPulseAudioSoundManager->>TPulseAudioSoundManager: RequestOutputInterrupt()
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title reflects the main goal of the change: adding FreeBSD support, though the PR also broadens BSD handling beyond FreeBSD.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
CMakeLists.txt (1)

693-693: Consider adding a broader clang-format search.

Adding clang-format19 is good, but the naming convention varies across systems. FreeBSD ports typically install as clang-format<version> without a hyphen (e.g., clang-format19), while some systems use clang-format-19.

Optional: Expand search names for broader compatibility
 find_program(CLANG_FORMAT_EXECUTABLE
-    NAMES clang-format-14 clang-format-mp-14 clang-format19 clang-format
+    NAMES clang-format-14 clang-format-mp-14 clang-format19 clang-format-19 clang-format
     HINTS /usr/local/opt/clang-format@14/bin/ /usr/lib/llvm-14/bin/
     DOC "clang-format executable")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CMakeLists.txt` at line 693, Update the NAMES list used when locating
clang-format in CMakeLists.txt to include additional common variants so the find
command matches both hyphenated and non-hyphenated installs; specifically add
names like clang-format-19, clang-format-14, clang-format-15, clang-format-16
(and their non-hyphenated counterparts) alongside the existing clang-format and
clang-format19 entries in the NAMES list so the finder used in this
CMakeLists.txt will locate clang-format across more platforms.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@CMakeLists.txt`:
- Line 693: Update the NAMES list used when locating clang-format in
CMakeLists.txt to include additional common variants so the find command matches
both hyphenated and non-hyphenated installs; specifically add names like
clang-format-19, clang-format-14, clang-format-15, clang-format-16 (and their
non-hyphenated counterparts) alongside the existing clang-format and
clang-format19 entries in the NAMES list so the finder used in this
CMakeLists.txt will locate clang-format across more platforms.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f21490 and 2bfd5f0.

📒 Files selected for processing (4)
  • CMakeLists.txt
  • Emulator/NativeCalls/CMakeLists.txt
  • Emulator/Serial/CMakeLists.txt
  • Emulator/Sound/CMakeLists.txt

@LaurentChardon

Copy link
Copy Markdown
Author

Looking at the "nitpick" comment from coderabbit, I realize that the addition of clang-format19 is not strictly necessary and can be removed. It's simpler and better for me as the packager to use a packaging tool that allows me to alias clang-format19 to clang-format.

@ekoeppen

ekoeppen commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Looks good to me, @MatthiasWM any thoughts?

Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
target_compile_options(EinsteinFLGUI PUBLIC -Wno-stringop-truncation)
endif()
target_compile_definitions ( Einstein PRIVATE
TARGET_UI_FLTK=1 TARGET_OS_LINUX=1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 BSD Builds Masquerade As Linux

The widened .*BSD$ branch still defines BSD builds as TARGET_OS_LINUX=1, so FreeBSD, NetBSD, and OpenBSD skip the existing BSD compile guards and enter Linux-specific paths. A BSD build can then miss BSD-only headers or ioctl handling, such as code guarded as !TARGET_OS_LINUX, and fail to compile or run networking through the wrong platform path.

Comment thread CMakeLists.txt

find_program(CLANG_FORMAT_EXECUTABLE
NAMES clang-format-14 clang-format-mp-14 clang-format
NAMES clang-format-14 clang-format-mp-14 clang-format19 clang-format

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Formatter Version Drift

This now prefers clang-format19 over an unversioned clang-format when clang-format-14 is absent. On systems where local formatting uses this CMake target but other hooks or CI still use clang-format 13 or 14, the same source tree can be reformatted differently and make formatting checks fail.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread CMakeLists.txt
Comment on lines +459 to +463
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(Einstein PUBLIC -Wno-stringop-truncation)
target_compile_options(EinsteinTests PUBLIC -Wno-stringop-truncation)
target_compile_options(EinsteinFLGUI PUBLIC -Wno-stringop-truncation)
endif()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Compiler flag leak This check still applies -Wno-stringop-truncation to the whole target when either compiler is GNU. In a mixed setup such as CC=gcc CXX=clang++, the condition is true, so the C++ compile for EinsteinTests and EinsteinFLGUI can still receive this GCC-only option while building with -Werror. That can fail the build even though the C++ compiler is not GNU. Apply the option per language and compiler instead of at target scope.

Comment thread CMakeLists.txt
target_compile_options(EinsteinFLGUI PUBLIC -Wno-stringop-truncation)
endif()
target_compile_definitions ( Einstein PRIVATE
TARGET_UI_FLTK=1 TARGET_OS_LINUX=1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 BSD builds as Linux This branch now includes FreeBSD and NetBSD, but it still defines those builds as TARGET_OS_LINUX=1. That sends BSD compiles through Linux-only preprocessor paths; for example the platform definitions select the Linux endian header path instead of the BSD <sys/endian.h> path. A FreeBSD or NetBSD build can therefore fail before the new BSD source selection helps. Define a BSD platform macro for .*BSD$ targets instead of reusing the Linux one.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Emulator/Sound/TPulseAudioSoundManager.cpp`:
- Around line 59-63: Initialize every PulseAudio pointer member, including
mPAContext and related mainloop/stream pointers, to nullptr in the
TPCircleBufferSoundManager constructor initializer list before any setup calls.
This ensures the error path can safely evaluate pointer checks when
pa_threaded_mainloop_new() or pa_threaded_mainloop_get_api() fails.
- Around line 232-262: Update the teardown logic in the destructor to call
pa_stream_unref(mOutputStream) after pa_stream_disconnect and
pa_context_unref(mPAContext) after pa_context_disconnect, guarding each with its
existing null check and preserving the mainloop locking order.
- Line 497: Replace the non-portable MIN call in the relevant sound manager
method with std::min<size_t>(mOutputBuffer->AvailableBytes(), bytesToWrite), and
add the <algorithm> include needed for std::min.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 05ac1a76-c105-47df-8ebf-da9d1d1f76d2

📥 Commits

Reviewing files that changed from the base of the PR and between e531c34 and 4f71a49.

📒 Files selected for processing (2)
  • Emulator/Sound/TPulseAudioSoundManager.cpp
  • Emulator/Sound/TPulseAudioSoundManager.h

Comment on lines +59 to +63
mOutputBuffer(new TCircleBuffer(
kNewtonBufferSizeInFrames * 4 * sizeof(KUInt16))),
mDataMutex(new TMutex()),
mOutputIsRunning(false)
mOutputIsRunning(false),
mOutputRequestPending(false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate relevant files
git ls-files | rg 'Emulator/Sound/TPulseAudioSoundManager\.(cpp|h|hpp)$'

# Show constructor and error-path sections with line numbers
for f in Emulator/Sound/TPulseAudioSoundManager.cpp Emulator/Sound/TPulseAudioSoundManager.h; do
  if [ -f "$f" ]; then
    echo "===== $f ====="
    nl -ba "$f" | sed -n '1,260p'
  fi
done

Repository: pguyot/Einstein

Length of output: 333


🏁 Script executed:

#!/bin/bash
set -euo pipefail

for f in Emulator/Sound/TPulseAudioSoundManager.cpp Emulator/Sound/TPulseAudioSoundManager.h; do
  if [ -f "$f" ]; then
    echo "===== $f ====="
    # Show file with line numbers using cat -n, focused on likely relevant ranges
    case "$f" in
      *.cpp) sed -n '1,260p' "$f" | cat -n | sed -n '1,260p' ;;
      *.h)   sed -n '1,240p' "$f" | cat -n | sed -n '1,240p' ;;
    esac
  fi
done

# Also extract just the constructor/error label vicinity for quicker review
echo "===== focused constructor/error-path search ====="
rg -n -A4 -B4 'pa_threaded_mainloop_new|goto error|pa_context_errno|mPAContext|mPAMainLoop|mPAMainLoopAPI|mOutputStream|mPAOperation|mPAOperationDescr' Emulator/Sound/TPulseAudioSoundManager.cpp Emulator/Sound/TPulseAudioSoundManager.h

Repository: pguyot/Einstein

Length of output: 38255


🏁 Script executed:

#!/bin/bash
set -euo pipefail

for f in Emulator/Sound/TPulseAudioSoundManager.cpp Emulator/Sound/TPulseAudioSoundManager.h; do
  if [ -f "$f" ]; then
    echo "===== $f ====="
    case "$f" in
      *.cpp) sed -n '1,260p' "$f" | cat -n | sed -n '1,260p' ;;
      *.h)   sed -n '1,240p' "$f" | cat -n | sed -n '1,240p' ;;
    esac
  fi
done

echo "===== focused constructor/error-path search ====="
rg -n -A4 -B4 'pa_threaded_mainloop_new|goto error|pa_context_errno|mPAContext|mPAMainLoop|mPAMainLoopAPI|mOutputStream|mPAOperation|mPAOperationDescr' Emulator/Sound/TPulseAudioSoundManager.cpp Emulator/Sound/TPulseAudioSoundManager.h

Repository: pguyot/Einstein

Length of output: 38255


Initialize the PulseAudio pointer members in the ctor init list
mPAContext is read on the error: path before any assignment if pa_threaded_mainloop_new() or pa_threaded_mainloop_get_api() fails, so the current if (mPAContext) check can hit undefined behavior. Initialize all pointer members to nullptr up front.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Emulator/Sound/TPulseAudioSoundManager.cpp` around lines 59 - 63, Initialize
every PulseAudio pointer member, including mPAContext and related
mainloop/stream pointers, to nullptr in the TPCircleBufferSoundManager
constructor initializer list before any setup calls. This ensures the error path
can safely evaluate pointer checks when pa_threaded_mainloop_new() or
pa_threaded_mainloop_get_api() fails.

Comment on lines +232 to +262
if (mPAMainLoop)
{
pa_threaded_mainloop_lock(mPAMainLoop);
}
pa_stream_set_write_callback(mOutputStream, NULL, NULL);
pa_stream_set_underflow_callback(mOutputStream, NULL, NULL);
pa_stream_set_state_callback(mOutputStream, NULL, NULL);
// disconnect the stream
pa_stream_disconnect(mOutputStream);
pa_context_disconnect(mPAContext);
// pa_threaded_mainloop_stop
if (mPAContext)
{
pa_context_disconnect(mPAContext);
}
if (mPAMainLoop)
{
pa_threaded_mainloop_unlock(mPAMainLoop);
}
}
if (mPAMainLoop)
{
pa_threaded_mainloop_stop(mPAMainLoop);
pa_threaded_mainloop_free(mPAMainLoop);
}
if (mDataMutex)
{
delete mDataMutex;
}
if (mOutputBuffer)
{
delete mOutputBuffer;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm whether stream/context are ever unref'd in this manager.
fd -t f 'TPulseAudioSoundManager.cpp' --exec rg -n 'pa_stream_unref|pa_context_unref|pa_stream_disconnect|pa_context_disconnect' {}

Repository: pguyot/Einstein

Length of output: 315


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file='Emulator/Sound/TPulseAudioSoundManager.cpp'

# Show the constructor error path and destructor around the relevant lines.
sed -n '180,260p' "$file" | cat -n

echo
echo '---'
echo 'All PulseAudio cleanup calls in this file:'
rg -n 'pa_stream_unref|pa_context_unref|pa_stream_disconnect|pa_context_disconnect|pa_threaded_mainloop_stop|pa_threaded_mainloop_free' "$file"

Repository: pguyot/Einstein

Length of output: 2885


Unref the PulseAudio stream and context on teardown pa_stream_disconnect()/pa_context_disconnect() only disconnect; this destructor still leaves both objects allocated on the normal path. Add pa_stream_unref(mOutputStream) and pa_context_unref(mPAContext) after disconnecting, mirroring the constructor error path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Emulator/Sound/TPulseAudioSoundManager.cpp` around lines 232 - 262, Update
the teardown logic in the destructor to call pa_stream_unref(mOutputStream)
after pa_stream_disconnect and pa_context_unref(mPAContext) after
pa_context_disconnect, guarding each with its existing null check and preserving
the mainloop locking order.

}

mDataMutex->Lock();
bytesToWrite = MIN(mOutputBuffer->AvailableBytes(), bytesToWrite);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether MIN is defined anywhere reachable and how it's provided.
rg -nP '\bdefine\s+MIN\b' 
rg -nP '`#include`\s*<sys/param\.h>|`#include`\s*<algorithm>' Emulator/Sound/TPulseAudioSoundManager.cpp

Repository: pguyot/Einstein

Length of output: 153


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== File outline =="
ast-grep outline Emulator/Sound/TPulseAudioSoundManager.cpp --view expanded || true

echo
echo "== Relevant file sections =="
nl -ba Emulator/Sound/TPulseAudioSoundManager.cpp | sed -n '1,120p'
echo
nl -ba Emulator/Sound/TPulseAudioSoundManager.cpp | sed -n '460,520p'

echo
echo "== Search for MIN and sys/param usage =="
rg -n --hidden --glob '!**/node_modules/**' '\bMIN\b|sys/param\.h|<algorithm>' Emulator/Sound . || true

Repository: pguyot/Einstein

Length of output: 550


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Top of file =="
sed -n '1,120p' Emulator/Sound/TPulseAudioSoundManager.cpp

echo
echo "== Relevant lines =="
sed -n '485,502p' Emulator/Sound/TPulseAudioSoundManager.cpp

echo
echo "== Repo-wide MIN definition search =="
rg -n --hidden --glob '!**/node_modules/**' '^[[:space:]]*#\s*define\s+MIN\b|[\(<[:space:]]MIN[\s\(]' .

echo
echo "== sys/param.h and algorithm includes =="
rg -n --hidden --glob '!**/node_modules/**' '#\s*include\s*<sys/param\.h>|#\s*include\s*<algorithm>' Emulator/Sound .

Repository: pguyot/Einstein

Length of output: 6765


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Search for MIN in K headers =="
rg -n --hidden --glob '!**/node_modules/**' '^[[:space:]]*#\s*define\s+MIN\b|^\s*#\s*include\s*<sys/param\.h>|^\s*#\s*include\s*<algorithm>' K Emulator/Sound app Monitor libffi portaudio || true

echo
echo "== K/Defines/KDefinitions.h =="
sed -n '1,220p' K/Defines/KDefinitions.h

echo
echo "== TPortAudioSoundManager.cpp top =="
sed -n '1,90p' Emulator/Sound/TPortAudioSoundManager.cpp

echo
echo "== TCoreAudioSoundManager.cpp top =="
sed -n '1,70p' Emulator/Sound/TCoreAudioSoundManager.cpp

Repository: pguyot/Einstein

Length of output: 12937


Use std::min here Emulator/Sound/TPulseAudioSoundManager.cpp:497 doesn’t bring in a portable MIN definition, so BSD builds may depend on a non-transitive system include. Add <algorithm> and use std::min<size_t>(...) instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Emulator/Sound/TPulseAudioSoundManager.cpp` at line 497, Replace the
non-portable MIN call in the relevant sound manager method with
std::min<size_t>(mOutputBuffer->AvailableBytes(), bytesToWrite), and add the
<algorithm> include needed for std::min.

Comment thread CMakeLists.txt
Comment on lines +460 to +464
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(Einstein PUBLIC -Wno-stringop-truncation)
target_compile_options(EinsteinTests PUBLIC -Wno-stringop-truncation)
target_compile_options(EinsteinFLGUI PUBLIC -Wno-stringop-truncation)
endif()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Compiler flag leak This guard still becomes true when only the C compiler is GNU, such as CC=gcc CXX=clang++. These targets compile C++ sources, and target_compile_options() applies the flag to the whole target, so Clang can still receive GCC-only -Wno-stringop-truncation. Because EinsteinTests and EinsteinFLGUI compile with -Werror, that mixed setup can fail the build on an unknown warning option.

Comment thread CMakeLists.txt
target_compile_options(EinsteinFLGUI PUBLIC -Wno-stringop-truncation)
endif()
target_compile_definitions ( Einstein PRIVATE
TARGET_UI_FLTK=1 TARGET_OS_LINUX=1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 BSD compiled as Linux FreeBSD and NetBSD now enter the widened BSD branch, but this definition still marks them as TARGET_OS_LINUX=1. That sends BSD builds through Linux preprocessor paths; for example the platform definitions select Linux <endian.h> instead of the BSD <sys/endian.h> branch. A FreeBSD or NetBSD build can fail before the newly selected BSD sources help.

@MatthiasWM

Copy link
Copy Markdown
Collaborator

Not using any of the BSD variants, just Ubuntu. Is there a specific order to this PR and #220 ?

@LaurentChardon

Copy link
Copy Markdown
Author

Not using any of the BSD variants, just Ubuntu. Is there a specific order to this PR and #220 ?

No, they should be independent. Thanks for checking them out!

PS: Einstein is now part of the official FreeBSD distribution:
https://ports.freebsd.org/cgi/ports.cgi?query=einstein-newton
https://www.freshports.org/emulators/einstein-newton/

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.

3 participants