Skip to content

Fix fakesdl headers when SDL directory included#26279

Open
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:fakesdl
Open

Fix fakesdl headers when SDL directory included#26279
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:fakesdl

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Feb 16, 2026

We introduced the fakesdl headers back in #18443 so that anyone trying to use SDL without using -sUSE_SDL (or similar) would see an error.

However we only covered the SDL_xx.h include case not the SDL/SDL_xx.h use case.

This means that some users were not seeing the errors they should, including a few of our test cases.

Split out from #26275

@sbc100 sbc100 requested a review from kripken February 16, 2026 18:36
@sbc100 sbc100 requested a review from dschuff February 16, 2026 18:37
@sbc100 sbc100 enabled auto-merge (squash) February 16, 2026 18:37
@sbc100 sbc100 force-pushed the fakesdl branch 5 times, most recently from 571a646 to 68118fa Compare February 16, 2026 21:32
We introduced the `fakesdl` headers back in emscripten-core#18443 so that anyone trying
to use SDL without using `-sUSE_SDL` (or similar) would see an error.

However we only covered the `SDL_xx.h` include case not the
`SDL/SDL_xx.h` use case.

This means that some users were not seeing the errors they should,
including a few of our test cases.

Split out from emscripten-core#26275
// Specify the SDL version that is being linked against:
//
// - 0, the default, means no SDL headers or libraries will be used.
// - 1 is port of SDL 1.3 which is implemented in JS.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// - 1 is port of SDL 1.3 which is implemented in JS.
// - 1 is a port of SDL 1.3 which is implemented in JS.

}
''')
self.do_runf('main.c', '1234, 1234, 4321\n')
self.do_runf('main.c', '1234, 1234, 4321\n', cflags=['-sUSE_SDL'])
Copy link
Member

Choose a reason for hiding this comment

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

Why is this now needed?

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.

2 participants

Comments