1
1
mirror of http://git.sesse.net/plocate synced 2025-10-05 23:42:49 +02:00

Check for endian.h before including it. Fixes compilation on FreeBSD.

This commit is contained in:
Steinar H. Gunderson
2020-10-31 12:24:34 +01:00
parent e375887f91
commit 73974b9b3e
3 changed files with 7 additions and 0 deletions

View File

@@ -12,6 +12,9 @@ atomicdep = cxx.find_library('atomic', required: false)
if not uringdep.found()
add_project_arguments('-DWITHOUT_URING', language: 'cpp')
endif
if cxx.has_header('endian.h')
add_project_arguments('-DHAS_ENDIAN_H', language: 'cpp')
endif
# Function multiversioning is x86-only _and_ not available on certain targets
# (they need “ifunc”, indirect functions, a GNU extension).

View File

@@ -15,7 +15,9 @@
#include <algorithm>
#include <assert.h>
#ifdef HAS_ENDIAN_H
#include <endian.h>
#endif
#include <limits.h>
#include <stdint.h>
#include <string.h>

View File

@@ -1,6 +1,8 @@
#include <algorithm>
#include <assert.h>
#ifdef HAS_ENDIAN_H
#include <endian.h>
#endif
#include <stdint.h>
#include <string.h>
#include <strings.h>