LibArchive: Guard against major() and minor() macros from old glibc
glibc before 2.28 defines major() and minor() macros from sys/types.h. This triggers a Lagom warning for old distros that use versions older than that, such as Ubuntu 18.04. This fixes a break in the compiler-explorer Lagom build, which is based off 18.04 docker containers.
This commit is contained in:
parent
d40167f7bb
commit
c774790975
Notes:
sideshowbarker
2024-07-17 09:47:09 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/c774790975 Pull-request: https://github.com/SerenityOS/serenity/pull/14486
1 changed files with 10 additions and 0 deletions
|
@ -13,6 +13,16 @@
|
|||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
// glibc before 2.28 defines these from sys/types.h, but we don't want
|
||||
// TarFileHeader::major() and TarFileHeader::minor() to use those macros
|
||||
#ifdef minor
|
||||
# undef minor
|
||||
#endif
|
||||
|
||||
#ifdef major
|
||||
# undef major
|
||||
#endif
|
||||
|
||||
namespace Archive {
|
||||
|
||||
enum class TarFileType : char {
|
||||
|
|
Loading…
Add table
Reference in a new issue