Skip to content

More bugfixes/improvements - #419

Merged
luciusDXL merged 12 commits into
TheForceEngine:masterfrom
mlauss2:applecompat
Jul 14, 2024
Merged

luciusDXL merged 12 commits into
TheForceEngine:masterfrom
mlauss2:applecompat

Conversation

@mlauss2

@mlauss2 mlauss2 commented Jul 8, 2024 •

Copy link
Copy Markdown
Contributor

More bug/warningfixes and updates, also to get it building on Apple/Clang toolchains. based on feedback in #90

  • QUAD_MAX is a reserved symbol in xnu's "limits.h" file
  • clang doesn't like passing std::string to logWrite()
  • disable clang's excessive warnings about unhandled enum values in switch() statements
  • fix lots of clang warnings about assignments inside while() without extra brackets.
  • adjust the min/max/clamp(size_t) functions to u64, since size_t == u32 on 32bit targets
  • LINE_MAX is another reserved symbol on xnu/apple.
  • change the size_t in memoryRegion, which is written out to savegames, to an u64, to keep apple toolchain happy and the savegame format independent of the target architecture size.
  • rename the "<autoselect>" audio device to "System Default", and change the System Midi "(Disabled)" device to explain why it's disabled (By choice, no synthesizers, or RtMidi error).

@mlauss2 mlauss2 changed the title Clang-Apple compatibiltiy More bugfixes Jul 8, 2024
mlauss2 added 2 commits July 8, 2024 11:23
On 32bit, the size_t min/max macros conflict with the u32 ones
(since size_t is u32 on 32bit).
Change the type from 'size_t' to 'u64' which is the correct type
on 64bit.
Fixes build for 32bit platforms.

Signed-off-by: Manuel Lauss <[email protected]>
MacOS syslimits.h defines a LINE_MAX macro which collides
with the LINE_MAX defined in lineDraw2d.
@mlauss2 mlauss2 mentioned this pull request Jul 8, 2024
@jodaco

jodaco commented Jul 8, 2024

Copy link
Copy Markdown

Definitely get much further with this PR on Mac, sent a minor PR to your original branch for CMakeLists to at least get the build going on Mac

mlauss2 added 3 commits July 10, 2024 08:41
On 64bit windows and linux, size_t is equal to an u64.
However, Apple toolchains seem to treat it as a distinct type,
and fail to find a specialization for FileStream::read()/::write().

By setting these types explicitly to u64,
- we do not break existing savegames on 64bit Windows/Linux
- also make savegames from 32bit builds compatible (but break
  existing ones, but I doubt that these exist).
- unify apple and linux under UNIX, but keep the linux-specific
  things under LINUX
- Drop Threads and OpenGL package requirements:
  Every modern UNIX OS has Threads; OpenGL is provided by GLEW.
- use the cmake "components" feature for SDL2 and SDL2_Image
because it doesn't work with github's runner.
@mlauss2 mlauss2 changed the title More bugfixes More bugfixes/improvements Jul 12, 2024
audio: autoselect -> System Default
system midi: disabled -> "Disabled: reason"

Signed-off-by: Manuel Lauss <[email protected]>
@mlauss2
mlauss2 marked this pull request as ready for review July 13, 2024 14:02

@luciusDXL luciusDXL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks for all of the improvements.

@luciusDXL
luciusDXL merged commit 400d539 into TheForceEngine:master Jul 14, 2024
@mlauss2
mlauss2 deleted the applecompat branch July 15, 2024 08:13
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