2 * This file is part of secnet.
3 * See README for full list of copyright holders.
5 * secnet is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version d of the License, or
8 * (at your option) any later version.
10 * secnet is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * version 3 along with secnet; if not, see
17 * https://www.gnu.org/licenses/gpl.html.
20 #ifndef fake_mLib_bits_h
21 #define fake_mLib_bits_h
23 /* The <mLib/bits.h> header defines a large number of types and macros for
24 * various kinds of bithacking. Notably, it has machinery for autodetecting
25 * suitable types holding (at least) various numbers of bits -- a service
26 * which C99 provides through other means.
28 * This file provides a small portion of the <mLib/bits.h> interface, just
29 * enough to make the pieces of code lifted from Catacomb feel at home.
33 #include "unaligned.h"
35 typedef uint8_t octet;
36 typedef uint32_t uint32;
37 typedef uint64_t uint64;
39 typedef int32_t int32;
40 typedef int64_t int64;
42 #define LOAD32_L(p) (get_uint32_le(p))
43 #define STORE32_L(p, x) put_uint32_le((p), (x))
45 #define U32(x) ((uint32)(x) & 0xffffffffu)
47 #endif /* fake_mLib_bits_h */