Skip to content

Commit

Permalink
Renaming type to avoid LTO collision with actual gl3w. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasnoble committed Oct 5, 2023
1 parent 69d5d28 commit 4082c7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 4082c7f

Please sign in to comment.