jpeg-dissector/src/util.h

30 lines
606 B
C
Raw Normal View History

2022-10-28 18:53:52 +02:00
#ifndef _UTIL_H
#define _UTIL_H
#include <stdio.h>
#ifdef NDEBUG
2022-10-28 21:13:54 +02:00
#define DEBUG_LOG
2022-10-28 18:53:52 +02:00
#else
2022-10-28 21:13:54 +02:00
#define DEBUG_LOG(...) printf("[DEBUG] "); printf(__VA_ARGS__); printf("\n")
2022-10-28 18:53:52 +02:00
#endif
2022-10-28 21:13:54 +02:00
#if defined(__GNUC__)
#define PACK( data ) data __attribute((__packed__))
#include <byteswap.h>
#define bswap_16 bswap_16
#define bswap_32 bswap_32
#define bswap_64 bswap_64
#elif defined(_MSC_VER)
#define PACK( data ) __pragma(pack(push, 1)) data __pragma(pack(pop))
#include <stdlib.h>
#define bswap_16 _byteswap_ushort
#define bswap_32 _byteswap_ulong
#define bswap_64 _byteswap_uint64
#endif
2022-10-28 18:53:52 +02:00
#endif // _UTIL_H