summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-01-08 20:43:26 +0100
committerJim Meyering <meyering@redhat.com>2012-01-08 20:43:26 +0100
commitd51bfc0bf33680e55cd528eac427573dad4e54e9 (patch)
tree426920173e47b676b73193245c4a6a31d0536534 /include
parent5ce39625c2619346b2ec5ea650159f3093a63009 (diff)
downloadparted-d51bfc0bf33680e55cd528eac427573dad4e54e9.tar.gz
libparted: don't use _GL_ATTRIBUTE_CONST in public parted.h, ...
Instead, use the bare __attribute__((__const__)). * include/parted/parted.h (__attribute): Define. (ped_get_version): Use open-coded __attribute. Prompted by a report from Keshav P R.
Diffstat (limited to 'include')
-rw-r--r--include/parted/parted.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/parted/parted.h b/include/parted/parted.h
index 6c0d2e1..dff6dca 100644
--- a/include/parted/parted.h
+++ b/include/parted/parted.h
@@ -25,6 +25,12 @@
extern "C" {
#endif
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+# define __attribute(arg) __attribute__ (arg)
+#else
+# define __attribute(arg)
+#endif
+
#include <parted/constraint.h>
#include <parted/device.h>
#include <parted/disk.h>
@@ -37,7 +43,10 @@ extern "C" {
#include <stdlib.h>
#include <string.h>
-extern const char* ped_get_version () _GL_ATTRIBUTE_CONST;
+extern const char *ped_get_version ()
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+ __attribute ((__const__));
+#endif
extern void* ped_malloc (size_t size);
extern void* ped_calloc (size_t size);