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

Renaming type to avoid LTO collision with actual gl3w. #3

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gl3w_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ def main():

strings = [
'/* gl3w internal state */',
'union GL3WProcs {',
'union ImGL3WProcs {',
' GL3WglProc ptr[{0}];'.format(len(procs)),
' struct {'
]
max_proc_len = max([len(p) for p in procs]) + 7
for proc in procs:
strings.append(' {0: <{2}} {1};'.format('PFN{0}PROC'.format(proc.upper()), proc[2:], max_proc_len))
strings.append(' } gl;') # struct
strings.append('};') # union GL3WProcs
strings.append('};') # union ImGL3WProcs
h_template = h_template.replace(strings[0], '\n'.join(strings))

strings = ['/* OpenGL functions */']
Expand Down
4 changes: 2 additions & 2 deletions template/gl3w.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ GL3W_API GL3WglProc imgl3wGetProcAddress(const char *proc);

/* gl3w internal state */

GL3W_API extern union GL3WProcs imgl3wProcs;
GL3W_API extern union ImGL3WProcs imgl3wProcs;

/* OpenGL functions */

Expand Down Expand Up @@ -258,7 +258,7 @@ GL3WglProc imgl3wGetProcAddress(const char *proc) { return get_proc(proc); }
static const char *proc_names[] = {
};

GL3W_API union GL3WProcs imgl3wProcs;
GL3W_API union ImGL3WProcs imgl3wProcs;

static void load_procs(GL3WGetProcAddressProc proc)
{
Expand Down