[comp.windows.x] C++ header files for X - important note

bob@odi.COM (Bob Miner) (09/26/89)

For those of you who are using or are about to use the header files
I recently posted to comp.sources.x (ansiXlib.h, ansiXt.h and ansiXm.h)
or mailed to you for using C++ with X, please note that I forgot to
mention one key point.  If you're using AT&T's version 2.0 of C++,
you need to do one of two things:

    * Surround your #include directives of these files with
      an extern "C" { }.  For example, your code might look
      like:
		extern "C" {
		#include "ansiXt.h"
		}

      This tells C++ that the function prototypes it's about
      to see are for vanilla C functions, not C++ functions.

    * In each include file, the last section of the file is
      the function prototypes with arguments.  Surround this
      section of each file with extern "C" { }.  You could
      also surround the whole file with extern "C" { } I suppose.

I use the first approach and forgot to mention it when I sent out the
header files.

I don't know what the effect of encountering an extern "C" within
an extern "C", so I'd recommend one or the other of the above
approaches, not both.

For earlier versions of AT&T's C++, this is not necessary.

Thanks to Tom Wolf for pointing this out to me.

Hope this hasn't caused anyone out there serious problems.

Bob Miner
					    Object Design Inc.
Internet: bob@odi.com			    1 New England Executive Park
Or: odi!bob@uunet.uu.net		    Burlington, MA 01803
Or: odi!bob@eddie.mit.edu		    (617) 270-9797