> From: Stephen Hemminger [mailto:step...@networkplumber.org]
> Sent: Monday, 22 April 2024 18.20
> 
> On Mon, 22 Apr 2024 17:24:43 +0200
> Morten Brørup <m...@smartsharesystems.com> wrote:
> 
> >   #define RTE_LOG_REGISTER_IMPL(type, name, level)                      \
> > - int type;                                                             \
> > + extern int type;                                                          
> >     \
> >   RTE_INIT(__##type)                                                        
> >     \
> >   {                                                                     \
> >     type = rte_log_register_type_and_pick_level(name,
> RTE_LOG_##level); \
> >     if (type < 0)
> \
> >             type = RTE_LOGTYPE_EAL;
> \
> >   }                                                                     \
> > + int type
> 
> 
> Not all logtypes can/should be extern.

Creativity just kicked in:

  #define RTE_LOG_REGISTER_IMPL(type, name, level)                          \
  int type;                                                                 \
  RTE_INIT(__##type)                                                        \
  {                                                                         \
        type = rte_log_register_type_and_pick_level(name, RTE_LOG_##level); \
        if (type < 0)                                                       \
                type = RTE_LOGTYPE_EAL;                                     \
  }                                                                         \
+ static_assert(1 == 1, "Dummy for semicolon.")

Reply via email to