diff options
author | Russ Allbery <rra@stanford.edu> | 2008-04-24 01:17:48 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-04-24 01:17:48 +0000 |
commit | 23b711ebacb2371915bfa4d9e0d386fa4e7cb35e (patch) | |
tree | 5041a42d5d48526322d827ef0e956f061e8064cc /portable/macros.h | |
parent | d509c915c9c3adc3b61eae84bdca0b612f25df96 (diff) |
Switch to messages-krb5 in util instead of the one built in the client
library and start the transition of coding style.
Diffstat (limited to 'portable/macros.h')
-rw-r--r-- | portable/macros.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/portable/macros.h b/portable/macros.h new file mode 100644 index 0000000..dcffa59 --- /dev/null +++ b/portable/macros.h @@ -0,0 +1,37 @@ +/* $Id$ + * + * Portability macros used in include files. + * + * Written by Russ Allbery <rra@stanford.edu> + * This work is hereby placed in the public domain by its author. + */ + +#ifndef PORTABLE_MACROS_H +#define PORTABLE_MACROS_H 1 + +/* + * __attribute__ is available in gcc 2.5 and later, but only with gcc 2.7 + * could you use the __format__ form of the attributes, which is what we use + * (to avoid confusion with other macros). + */ +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __attribute__(spec) /* empty */ +# endif +#endif + +/* + * BEGIN_DECLS is used at the beginning of declarations so that C++ + * compilers don't mangle their names. END_DECLS is used at the end. + */ +#undef BEGIN_DECLS +#undef END_DECLS +#ifdef __cplusplus +# define BEGIN_DECLS extern "C" { +# define END_DECLS } +#else +# define BEGIN_DECLS /* empty */ +# define END_DECLS /* empty */ +#endif + +#endif /* !PORTABLE_MACROS_H */ |