Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly include an enum by name #33

Merged
merged 3 commits into from
Sep 1, 2024
Merged

Explicitly include an enum by name #33

merged 3 commits into from
Sep 1, 2024

Conversation

lithiumtoast
Copy link
Member

@lithiumtoast lithiumtoast commented Aug 28, 2024

In the context of SDL, there is sometimes the following case:

/**
 * The predefined log priorities
 *
 * \since This enum is available since SDL 3.0.0.
 */
typedef enum SDL_LogPriority
{
    SDL_LOG_PRIORITY_VERBOSE = 1,
    SDL_LOG_PRIORITY_DEBUG,
    SDL_LOG_PRIORITY_INFO,
    SDL_LOG_PRIORITY_WARN,
    SDL_LOG_PRIORITY_ERROR,
    SDL_LOG_PRIORITY_CRITICAL,
    SDL_NUM_LOG_PRIORITIES
} SDL_LogPriority;
...
extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);

The API is defined as passing a SDL_LogPriority to the function SDL_LogGetPriority even if it's not directly referenced by type in the function parameter.

This code allows to manually pass in the names of enums to be included in the config.json:

  "includedNames": [
    "enum_name"
  ],

@lithiumtoast lithiumtoast merged commit b00c09a into main Sep 1, 2024
4 checks passed
@lithiumtoast lithiumtoast deleted the next branch September 1, 2024 00:04
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.

1 participant