Reputation: 184
Is it possible to compile Apache and its list of modules using a C++ compiler? That would make addition of C++ modules easier too. Right now I am working on adding some C++ modules, but if Apache itself were compiled as a C++ binary, that would make life much easier.
Upvotes: 1
Views: 241
Reputation: 98509
C++ and C are interoperable. You may link C++ code with C code and vice versa (although C++ methods called from C must be declared extern "C"
so as to not be mangled, and you lose the overloading which name mangling provides).
In fact, in the days when dinosaurs roamed the Earth, C++ compilers just emitted C and passed it down to a C compiler.
So, in a sense, you're already compiling Apache using a C++-compatible compiler (although its source is not C++): you shouldn't have any trouble at all writing a module as C++ and linking it in.
Upvotes: 4