yamt commented on PR #15579:
URL: https://github.com/apache/nuttx/pull/15579#issuecomment-2601304427

   > > > > > > > @yamt what's the benefit to generate the errno from a csv, but 
not modify errno.h direclty?
   > > > > > > 
   > > > > > > 
   > > > > > > i want to generate other things as well, which are difficult or 
impossible with C preprocessor. eg.
   > > > > > > ```c
   > > > > > > #if defined(EPERM)
   > > > > > > case EPERM: return NUTTX_EPERM;
   > > > > > > #endif
   > > > > > > ```
   > > > > > 
   > > > > > 
   > > > > > I still can't fully understand what you want to achieve with this 
code snippet, could you explain more?
   > > > > 
   > > > > 
   > > > > convert host errno to nuttx errno.
   > > > 
   > > > 
   > > > why not simply define EINVAL_LINUX, EINVAL_MACOS, EINVAL_WINDOWS 
directly, instead through errno_xxx.csv and mkerrno.py.
   > > 
   > > 
   > > EPREM in the above snippet is the host one. (just use the host errno.h) 
i don't see any benefit to have separate definitions for each platforms.
   > > > > > In most case, it's be better to complish the generation work as 
macro as we can.
   > > > > 
   > > > > 
   > > > > i can't think of any way to do the equivalent with C preprocessor 
alone.
   > > > 
   > > > 
   > > > sorry, I don't see any hard block issue to implement the conversion in 
c entirely.
   > > 
   > > 
   > > well, of course, i can keep the csv and script private and only submit 
the generated C files to nuttx. i don't see any benefit to hide how these files 
were actually generated though.
   > 
   > Does your solution share one errno.csv for all OS or have the seperate 
errno.csv for each OS? The complex of include/errno.csv and include/errno.h is 
almost same, so whether we can share the same errno.csv is a key point.
   
   errno.csv only defines things for nuttx.
   
   i have no plan to have csv files for other OSes. (linux, macos, etc)
   just because i don't see any needs for my purposes.
   
   
   
   
   


-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to