pixels: detect endianness via compiler defines

../src/pixels.c:24:10: fatal error: 'endian.h' file not found
 #include <endian.h>
          ^~~~~~~~~~
../src/pixels.c:58:6: error: expected value in expression
 #elif
      ^
pull/58/head
Jan Beich 2020-07-16 14:20:12 +00:00 committed by Andri Yngvason
parent 2cb9f663a0
commit 1bc095bd75
1 changed files with 2 additions and 3 deletions

View File

@ -21,7 +21,6 @@
#include <assert.h>
#include <libdrm/drm_fourcc.h>
#include <stdbool.h>
#include <endian.h>
enum wl_shm_format fourcc_to_wl_shm(uint32_t in)
{
@ -52,11 +51,11 @@ bool fourcc_to_pixman_fmt(pixman_format_code_t* dst, uint32_t src)
#define FMT_DRM(x, y, z, v, a, b, c, d) DRM_FORMAT_##x##y##z##v##a##b##c##d
#if __BYTE_ORDER == __LITTLE_ENDIAN
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define FMT_PIXMAN(x, y, z, v, a, b, c, d) \
CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(\
PIXMAN_, LOWER(x)), a), LOWER(y)), b), LOWER(z)), c), LOWER(v)), d)
#elif
#else
#define FMT_PIXMAN(x, y, z, v, a, b, c, d) \
CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(\
PIXMAN_, LOWER(v)), d), LOWER(z)), c), LOWER(y)), b), LOWER(x)), a)