Skip to content

Commit

Permalink
Use __linux__, not only __linux, to detect Linux
Browse files Browse the repository at this point in the history
According to https://sourceforge.net/p/predef/wiki/OperatingSystems/,
this is the macro specified by POSIX.

This change actually fixes failure to compile on the ppc64le version of
Red Hat Enterprise Linux 8. The fact that this is architecture-dependent
is probably a bug in that distribution.
  • Loading branch information
musicinmybrain committed Sep 1, 2022
1 parent 39abf99 commit f36cca5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/c4/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# else
# error "Unknown Apple platform"
# endif
#elif defined(__linux)
#elif defined(__linux__) || defined(__linux)
# define C4_UNIX
# define C4_LINUX
#elif defined(__unix)
Expand All @@ -36,7 +36,7 @@
# error "unknown platform"
#endif

#if defined(__posix) || defined(__unix__) || defined(__linux)
#if defined(__posix) || defined(__unix__) || defined(C4_LINUX)
# define C4_POSIX
#endif

Expand Down

0 comments on commit f36cca5

Please sign in to comment.