1/*
2 * generic krb5-types.h for cross compiling, assume system is posix/sus
3 */
4
5#ifndef __krb5_types_h__
6#define __krb5_types_h__
7
8#include <inttypes.h>
9#include <sys/types.h>
10#include <sys/socket.h>
11
12typedef socklen_t krb5_socklen_t;
13#include <unistd.h>
14typedef ssize_t krb5_ssize_t;
15
16#if !defined(__has_extension)
17#define __has_extension(x) 0
18#endif
19
20#define KRB5TYPES_REQUIRE_GNUC(m,n,p) \
21    (((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__) >= \
22     (((m) * 10000) + ((n) * 100) + (p)))
23
24
25#ifndef HEIMDAL_DEPRECATED
26#if __has_extension(deprecated) || KRB5TYPES_REQUIRE_GNUC(3,1,0)
27#define HEIMDAL_DEPRECATED __attribute__((deprecated))
28#elif defined(_MSC_VER) && (_MSC_VER>1200)
29#define HEIMDAL_DEPRECATED __declspec(deprecated)
30#else
31#define HEIMDAL_DEPRECATED
32#endif
33#endif
34
35#ifndef HEIMDAL_PRINTF_ATTRIBUTE
36#if __has_extension(format) || KRB5TYPES_REQUIRE_GNUC(3,1,0)
37#define HEIMDAL_PRINTF_ATTRIBUTE(x) __attribute__((format x))
38#else
39#define HEIMDAL_PRINTF_ATTRIBUTE(x)
40#endif
41#endif
42
43#ifndef HEIMDAL_NORETURN_ATTRIBUTE
44#if __has_extension(noreturn) || KRB5TYPES_REQUIRE_GNUC(3,1,0)
45#define HEIMDAL_NORETURN_ATTRIBUTE __attribute__((noreturn))
46#else
47#define HEIMDAL_NORETURN_ATTRIBUTE
48#endif
49#endif
50
51#ifndef HEIMDAL_UNUSED_ATTRIBUTE
52#if __has_extension(unused) || KRB5TYPES_REQUIRE_GNUC(3,1,0)
53#define HEIMDAL_UNUSED_ATTRIBUTE __attribute__((unused))
54#else
55#define HEIMDAL_UNUSED_ATTRIBUTE
56#endif
57#endif
58
59typedef int krb5_socket_t;
60
61#endif /* __krb5_types_h__ */
62