On 03/31/2014 04:55 AM, Rogovin, Kevin wrote:
Hi,

  I was doing some experiments and had linking issues with C++ code and saw that some 
Mesa header files have extern "C" wrappers and others do not. For example 
running:

$ find src/mesa/main -type f -name "*.h" -exec  grep  -H -E -o -c "extern 
\"C\"" {} \; | grep  :0 | wc -l

gives a result of 109 files. However, some header files in mesa/main and other places do 
have the extern "C" { wrapper, such as mesa/main/mtypes.h.

What is the rule, if any, of what files have the extern "C" protection so that 
the file is suitable for inclusion by C++ source files?

The headers with extern "C" are probably those that get included by the GLSL compiler code (which is in C++). Otherwise, I think extern "C" gets added on an as-needed basis.

-Brian


_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to