The argument for the #pragma in the ODP API files is that by design they should contain nothing that isn't intended for export, so not marking each struct/API individually both saves time and discourages someone trying to put something private in those files (by not marking the individual entity).
It's unfortunate that by design a C macro cannot emit a #pragma as this means you can't hide the somewhat awkward syntax. An alternative would be to wrap these #pragmas in separate #include files., e.g.: #include <odp_api_def_begin.h> ...odp API file contents #include <odp_api_def_end.h> On Fri, Apr 15, 2016 at 11:33 AM, Mike Holmes <mike.hol...@linaro.org> wrote: > Thanks all, this is on Mondays ARCH call to expedite things since we want > to get 1.9 out. > > On 15 April 2016 at 11:59, Ricardo Salveti <ricardo.salv...@linaro.org> > wrote: > >> On Fri, Apr 15, 2016 at 12:24 PM, Maxim Uvarov <maxim.uva...@linaro.org> >> wrote: >> > We need more review for that patch. >> > >> > From one side it's good changes and logically it's right to make api >> visible >> > and other functions not visible by default. From other point of view I >> can >> > not find any other libs which do exactly the same thing. So it's not >> clear >> > what we can break with that changes, if we can. >> >> We do have quite a few other examples of libraries and projects using >> a similar approach (e.g. mesa, wayland, tslib), but they are usually >> controlling symbol by symbol instead of using pragma for the entire >> header. >> >> A common example is defining EXPORT as __attribute__ >> ((visibility("default"))) and then manually having that as part of >> each public symbol/declaration. >> >> So I guess the decision to make is if we want to have that as part of >> the header, and if pragma or manual exposure via __attribute__ should >> be used. >> >> Cheers, >> -- >> Ricardo Salveti >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> https://lists.linaro.org/mailman/listinfo/lng-odp >> > > > > -- > Mike Holmes > Technical Manager - Linaro Networking Group > Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs > "Work should be fun and collaborative, the rest follows" > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp > >
_______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp