Stephane Marchesin wrote:
Hi,

What's the correct way of declaring inline functions inside a dri driver ? I see 4 ways to do that in existing code : __inline, __inline__, inline and INLINE. So, which one is the right one ? Or maybe there is a slight difference between those ?

Good question.

In core Mesa, there isn't an assumption of either gcc or c99 support in the compiler, so you have to use the INLINE macro to be safe.

Though the DRI drivers rely on gcc in various ways, the underscore usage probably snuck in from a time where we were specifying -std=c89 -ansi on the gcc command line, in which case gcc disallows 'inline' and required you to say '__inline' - though I'm not sure what the justification for that is.

So, in Mesa core, INLINE is probably still necessary. In the DRI drivers where you can expect to have a modern compiler, I would suggest that regular 'inline' be the preferred usage.

Keith


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to