]> git.ozlabs.org Git - ccan/blobdiff - ccan/autodata/autodata.h
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / autodata / autodata.h
index c9d774b982ee74256eb898917ed365ba1c7ac62d..1e513963f73f3209b2412782e38381fa5745ad59 100644 (file)
@@ -12,7 +12,7 @@
  * @name: the name for this set of autodata
  * @type: the type this autodata points to
  *
  * @name: the name for this set of autodata
  * @type: the type this autodata points to
  *
- * This macro is usually placed in a header: it must preceed any
+ * This macro is usually placed in a header: it must precede any
  * autodata functions in the file.
  *
  * Example:
  * autodata functions in the file.
  *
  * Example:
@@ -23,7 +23,7 @@
  */
 #define AUTODATA_TYPE(name, type)                                      \
        typedef type autodata_##name##_;                                \
  */
 #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
 
 /**
  * AUTODATA - add a pointer to this autodata set
@@ -42,7 +42,7 @@
  */
 #define AUTODATA(name, ptr) \
        static const autodata_##name##_ *NEEDED         \
  */
 #define AUTODATA(name, ptr) \
        static const autodata_##name##_ *NEEDED         \
-       __attribute__((section("autodata_" #name)))     \
+       __attribute__((section("xautodata_" #name)))    \
        AUTODATA_VAR_(name, __LINE__) = (ptr);
 
 /**
        AUTODATA_VAR_(name, __LINE__) = (ptr);
 
 /**
@@ -59,7 +59,8 @@
  * Example:
  *     static void print_embedded_names(void)
  *     {
  * Example:
  *     static void print_embedded_names(void)
  *     {
- *             unsigned int i, num;
+ *             unsigned int i;
+ *             size_t num;
  *             char **n = autodata_get(names, &num);
  *
  *             for (i = 0; i < num; i++)
  *             char **n = autodata_get(names, &num);
  *
  *             for (i = 0; i < num; i++)
@@ -68,8 +69,8 @@
  */
 #define autodata_get(name, nump)                                       \
        ((autodata_##name##_ **)                                        \
  */
 #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 */
 
 /**
 #endif /* HAVE_SECTION_START_STOP */
 
 /**