]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libfido2/src/packed.h
MFV 66082b6c88b9: libbsdxml (expat) 2.4.9
[FreeBSD/FreeBSD.git] / contrib / libfido2 / src / packed.h
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 */