summaryrefslogtreecommitdiff
path: root/src/packed.h
diff options
context:
space:
mode:
authornicoo <nicoo@debian.org>2020-02-12 13:43:18 +0100
committerNicolas Braud-Santoni <nicolas@braud-santoni.eu>2020-02-12 13:43:18 +0100
commit88a8bdd35ca7fb0c1ce70abdd8262d958fedafc1 (patch)
treece42d9d46d371c05eed82d8bb1e8aa7b2522a769 /src/packed.h
parent4e06e4554b69e678110563b1cf00a258a202dd7b (diff)
parentc79050aa44b8836d836c5dd22a383a073c28b74b (diff)
Merge upstream release 1.3.0 into debian/sid
Diffstat (limited to 'src/packed.h')
-rw-r--r--src/packed.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/packed.h b/src/packed.h
new file mode 100644
index 0000000..3857c22
--- /dev/null
+++ b/src/packed.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (c) 2018 Yubico AB. All rights reserved.
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file.
5 */
6
7#ifndef _PACKED_H
8#define _PACKED_H
9
10#if defined(__GNUC__)
11#define PACKED_TYPE(type, def) \
12 typedef def __attribute__ ((__packed__)) type;
13#elif defined(_MSC_VER)
14#define PACKED_TYPE(type, def) \
15 __pragma(pack(push, 1)) \
16 typedef def type; \
17 __pragma(pack(pop))
18#else
19#error "please provide a way to define packed types on your platform"
20#endif
21
22#endif /* !_PACKED_H */