Notwithstanding missing platform support - if the user wants the GL symbols, let him have them.
Use #warning or even #error to tell the API user that including this file on iOS is not meant to be.
I personally favor option 1.
If you want to write code that works on both OpenGL and OpenGL ES, it is not unreasonable to include the desktop GL headers and compensate for the differences manually. This doesn't work if the header is gated behind a platform check.
(Admittedly this is a niche case, since for this to work you basically need to write your own GL loader.)
Problem
When you include
SDL_opengl.h
while targeting iOS, it will silently just not define anything at all: https://github.com/libsdl-org/SDL/blob/e027b85cc457556071cbb2f3f1bcf8803c1bc001/include/SDL3/SDL_opengl.h#L33-L35 The API user, who expected this file to define OpenGL stuff, will be (momentarily) confused on why their code does not compile.Possible solutions
Notwithstanding missing platform support - if the user wants the GL symbols, let him have them.
Use
#warning
or even#error
to tell the API user that including this file on iOS is not meant to be.I personally favor option 1. If you want to write code that works on both OpenGL and OpenGL ES, it is not unreasonable to include the desktop GL headers and compensate for the differences manually. This doesn't work if the header is gated behind a platform check. (Admittedly this is a niche case, since for this to work you basically need to write your own GL loader.)