Skip to content

Commit

Permalink
fix test suite on big-endian v3
Browse files Browse the repository at this point in the history
  • Loading branch information
randy408 committed Aug 26, 2019
1 parent 9e6cc53 commit dcef767
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_png.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#ifndef TEST_PNG_H
#define TEST_PNG_H

#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || defined(__BIG_ENDIAN__)
#define SPNG_BIG_ENDIAN
#else
#define SPNG_LITTLE_ENDIAN
#endif

#include <png.h>
#include "spng.h"

Expand Down Expand Up @@ -103,7 +109,7 @@ unsigned char *getimage_libpng(unsigned char *buf, size_t size, size_t *out_size

/* png_set_palette_to_rgb() + png_set_tRNS_to_alpha() */
png_set_expand_16(png_ptr);
#if !defined(__BIG_ENDIAN__) /* we want host-endian values */
#if defined(SPNG_LITTLE_ENDIAN) /* we want host-endian values */
png_set_swap(png_ptr);
#endif
}
Expand Down

0 comments on commit dcef767

Please sign in to comment.