summaryrefslogtreecommitdiff
path: root/src/internal/perk_endian_impl.h
blob: a51393d083f2202f8e9b7e853a46229a3a179d10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/***************************************************************/
/*  perk: PE Resource Kit                                      */
/*  Copyright (C) 2015--2017  Z. Gilboa                        */
/*  Released under GPLv2 and GPLv3; see COPYING.PERK.          */
/***************************************************************/

#ifndef PERK_ENDIAN_IMPL_H
#define PERK_ENDIAN_IMPL_H

#include <stdbool.h>

#define PERK_LITTLE_ENDIAN	pe_little_endian_host()

static inline bool pe_little_endian_host(void)
{
	const long test = 1;
	return *((char *)&test);
}

#endif