hujun260 commented on PR #12601:
URL: https://github.com/apache/nuttx/pull/12601#issuecomment-2241437261

   > > How about using macros to isolate different implementations? list.h:
   > > ```
   > > #ifdef INLINE_QUEUE
   > > #define STATIC_INLINE static line
   > > #else
   > > #define STATIC_INLINE
   > > #endif
   > > 
   > > STATIC_INLINE void add_queue(void);
   > > #ifdef INLINE_QUEUE
   > > STATIC_INLINE void add_queue(void)
   > > {
   > >  #implement
   > > }
   > > #endif
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > list.c:
   > > ```
   > > #undef INLINE_QUEUE
   > > #include <list.h>
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > Make.defs
   > > ```
   > > ifneq ($(INLINE_QUEUE),y)
   > > CSRCS += list.c
   > > endif
   > > ```
   > 
   > @hujun260 How about this approach? You could still merge all list 
implementations into the header file
   
   If we use this approach, we would need to write the same implementation in 
both the header file and the source file. Subsequent modifications could lead 
to omissions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to