]> git.ozlabs.org Git - ccan/blobdiff - ccan/autodata/autodata.h
autodata: make note about not being generally useful for shared libraries.
[ccan] / ccan / autodata / autodata.h
index d16c6a5c465311a05d3810378892a768549ca357..3b1d01b4a83c1ec31d8529784e27f77f0d702962 100644 (file)
  * autodata functions in the file.
  *
  * Example:
+ *     #include <ccan/autodata/autodata.h>
+ *
  *     // My set of char pointers.
  *     AUTODATA_TYPE(names, char);
  */
 #define AUTODATA_TYPE(name, type)                                      \
        typedef type autodata_##name##_;                                \
-       extern type *__start_autodata_##name[], *__stop_autodata_##name[]
+       extern type *__start_xautodata_##name[], *__stop_xautodata_##name[]
 
 /**
  * AUTODATA - add a pointer to this autodata set
@@ -40,7 +42,7 @@
  */
 #define AUTODATA(name, ptr) \
        static const autodata_##name##_ *NEEDED         \
-       __attribute__((section("autodata_" #name)))     \
+       __attribute__((section("xautodata_" #name)))    \
        AUTODATA_VAR_(name, __LINE__) = (ptr);
 
 /**
@@ -66,8 +68,8 @@
  */
 #define autodata_get(name, nump)                                       \
        ((autodata_##name##_ **)                                        \
-        autodata_get_section(__start_autodata_##name,                  \
-                             __stop_autodata_##name, (nump)))
+        autodata_get_section(__start_xautodata_##name,                 \
+                             __stop_xautodata_##name, (nump)))
 #endif /* HAVE_SECTION_START_STOP */
 
 /**