Skip to content

Commit af285cd

Browse files
committed
exports: Just check for the visibility attribute.
The comment alludes to releases that are no longer relevant. Ubuntu 20.04 LTS is no longer supported, but even it has gcc 9. CentOS is in a much different state, but even the spiritual successor rockylinux 8.9 (out of its support window as well) has gcc 8. In short the compilers which do not support the has_attribute directive are no longer themselves supported.
1 parent bb8791c commit af285cd

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Include/exports.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,7 @@
3535
#define Py_LOCAL_SYMBOL
3636
#endif
3737
#else
38-
/*
39-
* If we only ever used gcc >= 5, we could use __has_attribute(visibility)
40-
* as a cross-platform way to determine if visibility is supported. However,
41-
* we may still need to support gcc >= 4, as some Ubuntu LTS and Centos versions
42-
* have 4 < gcc < 5.
43-
*/
44-
#if (defined(__GNUC__) && (__GNUC__ >= 4)) ||\
45-
(defined(__clang__) && _Py__has_attribute(visibility))
38+
#if _Py__has_attribute(visibility)
4639
#define Py_IMPORTED_SYMBOL __attribute__ ((visibility ("default")))
4740
#define Py_EXPORTED_SYMBOL __attribute__ ((visibility ("default")))
4841
#define Py_LOCAL_SYMBOL __attribute__ ((visibility ("hidden")))

0 commit comments

Comments
 (0)