summaryrefslogtreecommitdiffhomepage
path: root/src/internal/perk_endian_impl.h
blob: fe09c04f468813c219f9139378e963738bc7e26c (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--2021  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