define helper macros for __attribute__

This commit is contained in:
Love Hornquist Astrand
2010-10-26 23:39:42 -07:00
parent 82f7fcc9e9
commit a77070f5b1

View File

@@ -3,6 +3,8 @@
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Portions Copyright (c) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -250,6 +252,33 @@ int main(int argc, char **argv)
fprintf(f, "\n");
#endif /* KRB5 */
fprintf(f, "#ifndef HEIMDAL_DEPRECATED\n");
fprintf(f, "#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 )))\n");
fprintf(f, "#define HEIMDAL_DEPRECATED __attribute__((deprecated))\n");
fprintf(f, "#elif defined(_MSC_VER) && (_MSC_VER>1200)\n");
fprintf(f, "#define HEIMDAL_DEPRECATED __declspec(deprecated)\n");
fprintf(f, "#else\n");
fprintf(f, "#define HEIMDAL_DEPRECATED\n");
fprintf(f, "#endif\n");
fprintf(f, "#endif\n");
fprintf(f, "#ifndef HEIMDAL_PRINTF_ATTRIBUTE\n");
fprintf(f, "#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 )))\n");
fprintf(f, "#define HEIMDAL_PRINTF_ATTRIBUTE(x) __attribute__((format x))\n");
fprintf(f, "#else\n");
fprintf(f, "#define HEIMDAL_PRINTF_ATTRIBUTE(x)\n");
fprintf(f, "#endif\n");
fprintf(f, "#endif\n");
fprintf(f, "#ifndef HEIMDAL_NORETURN_ATTRIBUTE\n");
fprintf(f, "#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 )))\n");
fprintf(f, "#define HEIMDAL_NORETURN_ATTRIBUTE __attribute__((noreturn))\n");
fprintf(f, "#else\n");
fprintf(f, "#define HEIMDAL_NORETURN_ATTRIBUTE\n");
fprintf(f, "#endif\n");
fprintf(f, "#endif\n");
fprintf(f, "#endif /* %s */\n", hb);
if (f != stdout)