Skip to content

Commit

Permalink
pythongh-91731: Add macro compatibility for static_assert for old libcs
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed May 9, 2022
1 parent 9e146bb commit 53ecbb6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Include/pymacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
# define static_assert _Static_assert
#endif

// static_assert isd efined in GLIB from version 2.16. Before it requires
// compiler support (gcc >= 4.6) and is called _Static_assert.
#if defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ <= 16
# define static_assert _Static_assert
#endif
+

/* Minimum value between x and y */
#define Py_MIN(x, y) (((x) > (y)) ? (y) : (x))

Expand Down

0 comments on commit 53ecbb6

Please sign in to comment.