X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fautodata%2Fautodata.h;h=3f0a71a3f66d4024585a7b846d4928a7938d49c7;hb=ec8654d94d3c5c47aa5f82698f7e8048c79765b1;hp=d16c6a5c465311a05d3810378892a768549ca357;hpb=446eaa5f66db385d89357ba43aa5886f8b906ff0;p=ccan diff --git a/ccan/autodata/autodata.h b/ccan/autodata/autodata.h index d16c6a5c..3f0a71a3 100644 --- a/ccan/autodata/autodata.h +++ b/ccan/autodata/autodata.h @@ -16,12 +16,14 @@ * autodata functions in the file. * * Example: + * #include + * * // 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); /** @@ -57,7 +59,8 @@ * 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++) @@ -66,8 +69,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 */ /**