Make function pointer defined with METHOD() macro non-const
authorMartin Willi <martin@revosec.ch>
Mon, 14 May 2012 12:10:00 +0000 (14:10 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 14 May 2012 12:10:00 +0000 (14:10 +0200)
clang complains about it being const, and the object code
generated from gcc is the same.

src/libstrongswan/utils.h

index d09319d..6334b8e 100644 (file)
 #define METHOD(iface, name, ret, this, ...) \
        static ret name(union {iface *_public; this;} \
        __attribute__((transparent_union)), ##__VA_ARGS__); \
-       static const typeof(name) *_##name = (const typeof(name)*)name; \
+       static typeof(name) *_##name = (typeof(name)*)name; \
        static ret name(this, ##__VA_ARGS__)
 
 /**
 #define METHOD2(iface1, iface2, name, ret, this, ...) \
        static ret name(union {iface1 *_public1; iface2 *_public2; this;} \
        __attribute__((transparent_union)), ##__VA_ARGS__); \
-       static const typeof(name) *_##name = (const typeof(name)*)name; \
+       static typeof(name) *_##name = (typeof(name)*)name; \
        static ret name(this, ##__VA_ARGS__)
 
 /**