This reverts commit 0d2f7866ac.
This causes great mayhem in building/generating dtbuilder .msg files
(corrupting them, and inserting '(nil)' all over the place).
These would cause dtbuilder, and any other program built by dtcodegen
to have screwed up colors, missing callbacks and other mayhem.
This was confirmed by others on the list - reverting this made those
issues go away.
It may be that the int -> long is correct, but the NULL check
certainly does not seem to do what was intended. I'll leave it up to
Pascal to investigate :)
cpp was removed from /usr/libexec with FreeBSD 5.0-RELEASE.
Use __FreeBSD_version to tell imake if it's still there.
While here, X.Y.Z versioning ended with FreeBSD 3.0, so
we must be dealing with 2.Y.Z when checking for -lgnumalloc.
A patch from Pascal Stumpf using external jpeg broke linux builds,
since libjpeg needs to be linked in when using a remote jpeg lib.
So, in lnxLib.tmpl, define SharedDtHelpReqs so -ljpeg is used. Also,
in DtHelp/Imakefile, use proper Arch defines so external jpeg libs are
only used on linux, fbsd, and obsd systems.
This is a non-POSIX/ISO-C header. It is ok to include this on Linux, but it
is obsolete on BSD; FreeBSD even throws an error if you include it with
__STDC__ defined. Every system should nowadays have malloc() defined in
stdlib.h.
Diff is largely mechanical, replacing malloc.h with stdlib.h where it is not
yet included anyway.
Nowadays, OpenMotif is itself linked to libjpeg, so pulling in another
version of it causes symbol size mismatches, not to mention the maintenance
burden and security implications arising from keeping our own copy of libjpeg.
We still need some of the header files provided here because they are internal
to libjpeg and not installed on most distributions.
In part of the tooltalk rpc code (mp_message.c), it was assumed that on
the majority of platforms, sizeof(uid_t)=sizeof(gid_t)=sizeof(long). On
Linux-x64, uid_t is an unsigned int, which makes the code fail: all
tooltalk messages fail to send with an RPC_CANTENCODEARGS at the
rpc-level, and TT_INTERNAL_ERR for the actual program. We instead
change the code to explicitly examine sizeof(uid_t) to see whether it is
int or long sized. This allows tooltalk-dependent functinoality
like logout and multiple calls to dtfile to work.
Enums may be represented with a smaller type than int; however, they are
automatically promoted to int when passed in va_arg lists, just as
short, char, etc. are. GCC thus "knows" that you never want to call
va_arg with an enum type, and instead inserts an abort.
strstream.h is now called "strstream" and is obsolete, but use it anyway until
all code is converted over. This also needs std:: added, at least for GCC
4.2.1. Lastly, when hardcoding the path to perl, /usr/bin/perl should be used
rather than anything else.
Some of these older files just clutter up things and do not contribute
much information that is not historical in nature, so preserve them
in an out of the way location.
Mostly this is adding appropriate #includes and declarations,
but for WmImage.c we also change from using the proper name
for XmeGetMask, rather than the identical but renamed
version _DtGetMask which is not exported in any header.