On 9 April 2016 at 20:07, Mike Holmes <mike.hol...@linaro.org> wrote: > > > On 8 April 2016 at 17:14, Anders Roxell <anders.rox...@linaro.org> wrote: >> >> Internal functions should not be part of symbols is visible outside the >> library. >> >> Suggested-by: Ricardo Salveti <ricardo.salv...@linaro.org> >> Signed-off-by: Anders Roxell <anders.rox...@linaro.org> >> --- >> .../linux-generic/include/odp_packet_io_internal.h | 23 >> +++++++++++++--------- >> 1 file changed, 14 insertions(+), 9 deletions(-) >> >> diff --git a/platform/linux-generic/include/odp_packet_io_internal.h >> b/platform/linux-generic/include/odp_packet_io_internal.h >> index cca5c39..5c40c51 100644 >> --- a/platform/linux-generic/include/odp_packet_io_internal.h >> +++ b/platform/linux-generic/include/odp_packet_io_internal.h >> @@ -45,6 +45,11 @@ extern "C" { >> * requested number of packets were not handled. */ >> #define SOCK_ERR_REPORT(e) (e != EAGAIN && e != EWOULDBLOCK && e != >> EINTR) >> >> +#if defined(__GNUC__) >> +# define HIDDEN __attribute__((visibility("hidden"))) > > > Should this be in the compiler hints.h with the others ?
either there or in in platform/linux-generic/include/odp_internal.h since its an internal define. Cheers, Anders > > include/odp/api/spec/hints.h:#define ODP_NORETURN > __attribute__((__noreturn__)) > include/odp/api/spec/hints.h:#define ODP_WEAK_SYMBOL > __attribute__((__weak__)) > include/odp/api/spec/hints.h:#define ODP_HOT_CODE > __attribute__((__hot__)) > include/odp/api/spec/hints.h:#define ODP_COLD_CODE > __attribute__((__cold__)) > > If it is part of the spec it is easier for other platforms to hide their > internals by reusing it. > > >> >> +#else >> +# define HIDDEN >> +#endif >> /* Forward declaration */ >> struct pktio_if_ops; >> >> @@ -171,7 +176,7 @@ typedef struct pktio_if_ops { >> int _odp_packet_cls_enq(pktio_entry_t *pktio_entry, const uint8_t *base, >> uint16_t buf_len, odp_packet_t *pkt_ret); >> >> -extern void *pktio_entry_ptr[]; >> +extern void HIDDEN *pktio_entry_ptr[]; >> >> static inline int pktio_to_id(odp_pktio_t pktio) >> { >> @@ -217,16 +222,16 @@ int single_recv_queue(pktio_entry_t *entry, int >> index, odp_packet_t packets[], >> int single_send_queue(pktio_entry_t *entry, int index, odp_packet_t >> packets[], >> int num); >> >> -extern const pktio_if_ops_t netmap_pktio_ops; >> -extern const pktio_if_ops_t dpdk_pktio_ops; >> -extern const pktio_if_ops_t sock_mmsg_pktio_ops; >> -extern const pktio_if_ops_t sock_mmap_pktio_ops; >> -extern const pktio_if_ops_t loopback_pktio_ops; >> +extern const HIDDEN pktio_if_ops_t netmap_pktio_ops; >> +extern const HIDDEN pktio_if_ops_t dpdk_pktio_ops; >> +extern const HIDDEN pktio_if_ops_t sock_mmsg_pktio_ops; >> +extern const HIDDEN pktio_if_ops_t sock_mmap_pktio_ops; >> +extern const HIDDEN pktio_if_ops_t loopback_pktio_ops; >> #ifdef HAVE_PCAP >> -extern const pktio_if_ops_t pcap_pktio_ops; >> +extern const HIDDEN pktio_if_ops_t pcap_pktio_ops; >> #endif >> -extern const pktio_if_ops_t tap_pktio_ops; >> -extern const pktio_if_ops_t * const pktio_if_ops[]; >> +extern const HIDDEN pktio_if_ops_t tap_pktio_ops; >> +extern const HIDDEN pktio_if_ops_t * const pktio_if_ops[]; >> >> int sysfs_stats(pktio_entry_t *pktio_entry, >> odp_pktio_stats_t *stats); >> -- >> 2.8.0.rc3 >> >> _______________________________________________ >> 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 │ 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