krb5-types.h revision 1.7
1#ifndef __krb5_types_h__
2#define __krb5_types_h__
3
4#include <inttypes.h>
5#include <sys/types.h>
6#include <sys/socket.h>
7
8
9typedef socklen_t krb5_socklen_t;
10#include <unistd.h>
11typedef ssize_t krb5_ssize_t;
12
13typedef int krb5_socket_t;
14
15#if !defined(__has_extension)
16#define __has_extension(x) 0
17#endif
18
19#ifndef KRB5TYPES_REQUIRE_GNUC
20#define KRB5TYPES_REQUIRE_GNUC(m,n,p) \
21    (((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__) >= \
22     (((m) * 10000) + ((n) * 100) + (p)))
23#endif
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
59#ifndef HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE
60#if __has_extension(warn_unused_result) || KRB5TYPES_REQUIRE_GNUC(3,3,0)
61#define HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE __attribute__ ((__warn_unused_result__))
62#else
63#define HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE
64#endif
65#endif
66
67#endif /* __krb5_types_h__ */
68