-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I've run into a couple issues while working with Glk in C++.
- The Glk ABI is C (no mangled names), but the provided
glk.hheader (at https://www.eblong.com/zarf/glk/glk.h) provides C++ (mangled) names when used with a C++ compiler. Client code can, of course, wrap the include inextern "C", but it would be very convenient if insteadglk.hitself had such a declaration, wrapped in#ifdef __cplusplus. - There are many functions which accept a
char *parameter whereconst char *would be preferred. This is actually not strictly a C++ issue, given that it's reasonable in C to useconst char *for safety, and then be forced to cast tochar *, but it's more pronounced in C++ where string literals have type "array of const char" instead of "array of char".
I request that the offical Glk header file be updated to be more friendly to C++. These changes shouldn't affect existing programs which make use of Glk, except perhaps if a pointer to one of the char *-accepting functions is being stored... but that's probably unlikely, and would be easy to change.
Metadata
Metadata
Assignees
Labels
No labels