Bug#191737: acknowledged by developer (Re: Bug#191737: xinerama.h is missing extern C { for C++ compiling)

2003-05-04 Thread Marcelo E. Magallon
>> Daniel Stone <[EMAIL PROTECTED]> writes:

 > Yes, but it's not Xinerama's problem, and I don't see why it should be
 > bending over backwards to support people using it from another language.
 > I certainly won't be including this patch in my tree.

 Because that's the polite way of coding C header files.  You can't be
 so shortsighted to assume that the library is never going to be used by
 C++ programs (or any other languaje that can interface with C for that
 matter), specially when one of the reasons for choosing C over C++ is
 that the former is more interoperable than the later.  Quoting
 Stroustrup:

C programmers typically assume any C header can be used from a C++
program. This assumption has largely been true (after someone adds
suitable extern "C" directives), though headers that use C++
keywords as identifiers have been a constant irritant to C++
programmers (and sometimes a serious practical problem). 

[...]

The ability to share header files is an important aspect of C and
C++ culture and a key to performance of programs using both
languages. If the header files are kept compatible, C and C++
programs can call libraries implemented in "the other language" with
no data conversion overheads and no (or very minimal) call overhead.

 Granted, C++ programmers _are_ snottish in this respect, but there's no
 good reason for C programmers to behave the same way.

 Historically X has been a bad citizen in this general regard (True,
 False, Bool, Status, DirectColor and a lot of others pollute the
 namespace) but it does the right thing when it comes to extern "C".
 You just have to add a simple _XFUNCPROTOBEGIN / _XFUNCPROTOEND to the
 headers.

 Marcelo




Bug#191737: acknowledged by developer (Re: Bug#191737: xinerama.h is missing extern C { for C++ compiling)

2003-05-03 Thread James Troup
Daniel Stone <[EMAIL PROTECTED]> writes:

> Yes, but it's not Xinerama's problem, and I don't see why it should
> be bending over backwards to support people using it from another
> language.

Err, because that's the way things are done?  Have a look at the
include files from any major library you have installed and chances
are it'll use the 'extern "C"' vodoo.  Even XPM does ...

-- 
James




Bug#191737: acknowledged by developer (Re: Bug#191737: xinerama.h is missing extern C { for C++ compiling)

2003-05-03 Thread Daniel Stone
On Sat, May 03, 2003 at 10:43:21PM +1000, Ken Foskey wrote:
> C++ programmers cannot know whether a library is C only of C++ in every
> instance.  The only error we get is a obscure link message of a missing
> _Z16XineramaIsActiveP9_XDisplay

Well, you should probably know your major libraries better than that.
The only C++ library in XFree86 is libGLU.

> Not very easy to debug, easy to fix the include so that people do not
> get tripped up though.  Also SUSE have included a fix at source which is
> why the problem is random.

Yes, but it's not Xinerama's problem, and I don't see why it should be
bending over backwards to support people using it from another language.
I certainly won't be including this patch in my tree.

Don't get me wrong, I'm all for C++ (see my .signature), but I just
don't see any reason why Xinerama should be doing the extern "C" work
itself.

> http://ftp.suselinux.hu/suse/i386/supplementary/X/XFree86/XFree86-4.2.0-SuSE/CHANGES
> 
> Where do I go to raise the problem direct at source?

http://bugs.xfree86.org.

-- 
Daniel Stone <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
KDE: Konquering a desktop near you - http://www.kde.org


pgpQpZKxI163x.pgp
Description: PGP signature


Bug#191737: acknowledged by developer (Re: Bug#191737: xinerama.h is missing extern C { for C++ compiling)

2003-05-03 Thread Ken Foskey
> On Sat, May 03, 2003 at 08:35:21PM +1000, Ken Foskey wrote:
> > The Xinerama.h file is missing the following construct from the top and
> > bottom of the file.  This allows it to be safely used in C++ programs,=20
> > this is a build bug for the very latest OpenOffice.org.  This is also
> > the case on RedHat, Suse, etc so it is definitely an upstream problem.
> >=20
> > #ifdef __cplusplus
> > extern "C" {
> > #endif
> >=20
> > #ifdef __cplusplus
> > };
> > #endif
> 
> Uh, how is this X11's fault?
> 
> extern "C" {
> #include 
> }
> 
> Closing this spurious bug. Xinerama is a C library, so you should take
> the appropriate cautions when interfacing with it, not the other way
> around.

C++ programmers cannot know whether a library is C only of C++ in every
instance.  The only error we get is a obscure link message of a missing
_Z16XineramaIsActiveP9_XDisplay

Not very easy to debug, easy to fix the include so that people do not
get tripped up though.  Also SUSE have included a fix at source which is
why the problem is random.

http://ftp.suselinux.hu/suse/i386/supplementary/X/XFree86/XFree86-4.2.0-SuSE/CHANGES

Where do I go to raise the problem direct at source?

-- 
Thanks
KenF
OpenOffice.org developer