aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2006-09-15 18:52:36 +0000
committerLev Walkin <vlm@lionet.info>2006-09-15 18:52:36 +0000
commit3f6afc1e6ac7cada736f2f9a9910f7c3c087c1b4 (patch)
treee8730d21d447dd722abbe0781df8ee018b7a2591
parentafda1a50aa9c26b7512e74f01b2386e68ebf9998 (diff)
gcc 2.95.x does not like __attribute__ on typedefs
-rw-r--r--skeletons/asn_application.h3
-rw-r--r--skeletons/asn_system.h10
2 files changed, 9 insertions, 4 deletions
diff --git a/skeletons/asn_application.h b/skeletons/asn_application.h
index 3f2a4504..f40cd86a 100644
--- a/skeletons/asn_application.h
+++ b/skeletons/asn_application.h
@@ -36,8 +36,7 @@ typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size,
typedef void (asn_app_constraint_failed_f)(void *application_specific_key,
struct asn_TYPE_descriptor_s *type_descriptor_which_failed,
const void *structure_which_failed_ptr,
- const char *error_message_format, ...)
- __attribute__((format(printf, 4, 5)));
+ const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5);
#ifdef __cplusplus
}
diff --git a/skeletons/asn_system.h b/skeletons/asn_system.h
index 568213f5..d7ebdaa4 100644
--- a/skeletons/asn_system.h
+++ b/skeletons/asn_system.h
@@ -78,8 +78,14 @@ typedef unsigned int uint32_t;
#endif /* WIN32 */
-#ifndef __GNUC__
-#define __attribute__(ignore)
+#if __GNUC__ >= 3
+#ifndef GCC_PRINTFLIKE
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#endif
+#else
+#ifndef GCC_PRINTFLIKE
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+#endif
#endif
#ifndef offsetof /* If not defined by <stddef.h> */