lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> People have just
> become used to that code appearing in C libraries and I'm sure a lot
> don't even know what extern "C" does or why it's there.

I think a sensible alternative pops up in each thread on
this issue as well.  Don't use the C lua headers, but use
C++ counterparts instead.  Suggestion: distribute files
clua.h, clauxlib.h and clualib.h (in the ./include dir)
and mention them in the manual, where each file simply wraps
the C header:

in clua.h:

extern "C" {
#include <lua.h>
}

etc.  (An #ifndef guard is not strictly necessary, but may be
nicer?)

Now you can do:

#include <clua>

etc. in your C++ code (no suffix).

This is the C++ convention to use C standard headers so why not
use it for Lua?  (lua.h will become a standard header right?
;-))  You still need to read the manual though...

Bye,
Wim