Skip to content

Commit

Permalink
guard some macros against redefinitions
Browse files Browse the repository at this point in the history
  • Loading branch information
rswinkle committed Jun 18, 2024
1 parent 2ae9df5 commit 28cd76a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions portablegl.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ extern "C" {
#define PGL_ASSERT(x) assert(x)
#endif

#ifndef CVEC_ASSERT
#define CVEC_ASSERT(x) PGL_ASSERT(x)
#endif

#if defined(PGL_MALLOC) && defined(PGL_FREE) && defined(PGL_REALLOC)
/* ok */
Expand Down Expand Up @@ -354,7 +356,9 @@ extern "C" {
#endif

// Get rid of signed/unsigned comparison warnings when looping through vectors
#ifndef CVEC_SIZE_T
#define CVEC_SIZE_T i64
#endif

#ifndef CRSW_MATH_H
#define CRSW_MATH_H
Expand Down
4 changes: 4 additions & 0 deletions src/generate_gl_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
#define PGL_ASSERT(x) assert(x)
#endif
#ifndef CVEC_ASSERT
#define CVEC_ASSERT(x) PGL_ASSERT(x)
#endif
#if defined(PGL_MALLOC) && defined(PGL_FREE) && defined(PGL_REALLOC)
/* ok */
Expand Down Expand Up @@ -63,7 +65,9 @@
#endif
// Get rid of signed/unsigned comparison warnings when looping through vectors
#ifndef CVEC_SIZE_T
#define CVEC_SIZE_T i64
#endif
"""

Expand Down

0 comments on commit 28cd76a

Please sign in to comment.