On 9 April 2016 at 17:24, Bill Fischofer <bill.fischo...@linaro.org> wrote:
> Why is this restricted to GCC?  What happens when compiling with clang?  A
> quick experiment shows clang accepts the same __attribute__ without
> complaint but not sure what it does with it.

Clang works without a problem, so I don't think there is anything to do.

Cheers,
Anders

>
> On Fri, Apr 8, 2016 at 4:14 PM, 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")))
>> +#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
>
>
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to