Skip Menu |
 

Subject: win-mac.h "leaks" defines
When building against kfw (tested with 3.2.0), typical autoconf macros
are "leaked" into the client application from the include of win-mac.h.
For example, HAVE_NETINET_IN_H, HAVE_STRING_H and HAVE_STRDUP. This
causes redefinition warnings for other programs that use autoconf for
their own local configuration.

These defines should not be leaked into the public namespace that's
included when just including krb5.h or gssapi.h.
I suggested a while back pruning win-mac.h and removing some macros, but met with
resistance because, roughly, "someone might be using them". (This is why, when working on
cross-platform stuff with per-platform macros or whatever, I've avoided using win-mac.h and
put Windows support into other internal headers.)

I still think it would be a good idea. But, I'm still not the Windows maintainer....
[raeburn - Mon Jul 30 16:20:26 2007]:

Show quoted text
> I suggested a while back pruning win-mac.h and removing some macros,

I'm opposed to removal of #defines such as _USE_32BIT_TIME_T because
doing so would break applications that use the Kerberos API. If we
define _USE_32BIT_TIME_T and the app does not, then they will pass in a
64-bit value when we are expecting a 32-bit value.

I would not be opposed to removal of #defines such as:

#define HAVE_NETINET_IN_H
#define MSDOS_FILESYSTEM
#define HAVE_STRING_H
#define HAVE_SRAND
#define HAVE_ERRNO
#define HAVE_STRDUP
#define HAVE_GETADDRINFO
#define HAVE_GETNAMEINFO
#define NO_USERID
#define NO_PASSWORD
#define HAVE_STRERROR
#define SYS_ERRLIST_DECLARED
#define HAS_VOID_TYPE
#define HAVE_STDARG_H
#define HAVE_SYS_TYPES_H
#define HAVE_STDLIB_H

provided that they continue to be defined when building the krb5
libraries. There will need to be testing done to ensure that other MIT
applications which include the krb5 win-mac.h are not adversely affected.
From: Ken Raeburn <raeburn@MIT.EDU>
Subject: Re: [krbdev.mit.edu #5601] win-mac.h "leaks" defines
Date: Wed, 19 Sep 2007 04:21:06 -0400
To: rt@krbdev.mit.edu
RT-Send-Cc:
On Sep 19, 2007, at 00:54, Jeffrey Altman via RT wrote:
Show quoted text
> I would not be opposed to removal of #defines such as:
[...]
Show quoted text
> provided that they continue to be defined when building the krb5
> libraries.

Sure -- they belong in the windows version of autoconf.h, which would
then no longer be just a copy of win-mac.h. That's where we define
such macros for the other platforms, and that's where our code (at
least, the UNIX code) looks for them.

Actually, some of them should probably just go away altogether
because we require certain things, like the existence of "void" and
<stdarg.h> and strerror(). It wouldn't hurt for us to come up with a
list of just what we're requiring, at least whatever's not required
by C90.

Ken