+Mon Jun 10 21:54:09 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * com_err.h:
+ * error_table.h: Add Windows-32 ifdefs. Change use of
+ INTERFACE to KRB5_CALLCONV and KRB5_DLLIMP. See
+ ChangeLog entries for src/include/krb5.hin for more
+ information.
+
+
+ * vfprintf.c, internal.h, compile_et.c, et_c.awk, com_err.c:
+ Change _WINDOWS to _MSDOS, and add check for _WIN32.
+
Wed Mar 20 00:19:08 1996 Theodore Y. Ts'o <tytso@dcl>
* Makefile.in (SRCS): Fix SRCS definition so that it doesn't fool
#include <string.h>
#include "mit-sipb-copyright.h"
-#if defined(HAVE_STDARG_H) || defined(_WINDOWS) || defined (_MACINTOSH)
+#if defined(HAVE_STDARG_H) || defined(_MSDOS) || defined(_WIN32) || defined (_MACINTOSH)
#include <stdarg.h>
#else
#include <varargs.h>
* should fix up com_err.h so that it's safe to #include here
* directly.
*/
-#if defined(__STDC__) || defined(_WINDOWS)
-extern char const * INTERFACE error_message (long);
+#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)
+KRB5_DLLIMP extern char const FAR * KRB5_CALLCONV error_message (long);
#else
-extern char * INTERFACE error_message ();
+extern char * error_message ();
#endif
static void
-#if defined(__STDC__) || defined(_WINDOWS)
+#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)
default_com_err_proc (const char *whoami, long code, const char *fmt, va_list args)
#else
default_com_err_proc (whoami, code, fmt, args)
if (fmt) {
vsprintf (errbuf + strlen (errbuf), fmt, args);
}
-#ifdef _WINDOWS
+#if defined(_MSDOS) || defined(_WIN32)
MessageBox (NULL, errbuf, "Kerboros", MB_ICONEXCLAMATION);
#else
#ifdef _MACINTOSH
#endif
}
-#if defined(__STDC__) || defined(_WINDOWS)
+#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)
typedef void (*errf) (const char *, long, const char *, va_list);
#else
typedef void (*errf) ();
}
#ifndef VARARGS
-void INTERFACE_C com_err (const char *whoami,
+KRB5_DLLIMP void KRB5_CALLCONV_C com_err (const char *whoami,
long code,
const char *fmt, ...)
{
#else
-void INTERFACE_C com_err (va_alist)
+KRB5_DLLIMP void KRB5_CALLCONV_C com_err (va_alist)
va_dcl
{
const char *whoami, *fmt;
* programs are not including that file. We probably want to
* come up with a better way of handling this problem.
*/
-#ifndef INTERFACE
-#ifdef _WINDOWS
-#define INTERFACE __far __export __pascal
-#define INTERFACE_C __far __export __cdecl
+#if defined(_MSDOS) || defined (_WIN32)
+#ifdef _MSDOS
+ /* Windows 16 specific */
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV __far __export __pascal
+#define KRB5_CALLCONV_C __far __export __cdecl
+#define KRB5_DLLIMP
+#define INTERFACE KRB5_CALLCONV
+#define INTERFACE_C KRB5_CALLCONV_C
+#endif /* !KRB5_CALLCONV */
+#ifndef FAR
+#define FAR __far
+#define NEAR __near
+#endif
#else
+ /* Windows 32 specific */
+#ifndef KRB5_CALLCONV
+#ifdef KRB5_DLL_FILE
+#define KRB5_DECLSPEC dllexport
+#else
+#define KRB5_DECLSPEC dllimport
+#endif
+#define KRB5_DLLIMP __declspec(KRB5_DECLSPEC)
+#define KRB5_CALLCONV __stdcall
+#define KRB5_CALLCONV_C __cdecl
+#define INTERFACE KRB5_DLLIMP KRB5_CALLCONV
+#define INTERFACE_C KRB5_DLLIMP KRB5_CALLCONV_C
+#endif /* !KRB5_CALLCONV */
+
+#include <windows.h>
+
+#endif /* Win 16 vs Win 32 */
+#else /* Windows stuff */
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV
+#define KRB5_CALLCONV_C
+#define KRB5_DLLIMP
#define INTERFACE
#define INTERFACE_C
#endif
-#endif
+#endif /* Windows stuff */
+
#ifndef FAR
#define FAR
+#define NEAR
#endif
-#if defined(__STDC__) || defined(_WINDOWS)
+#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)
/* ANSI C -- use prototypes etc */
-extern void INTERFACE_C com_err (const char FAR *, long, const char FAR *, ...);
-extern const char FAR * INTERFACE error_message (long);
+KRB5_DLLIMP extern void KRB5_CALLCONV_C com_err
+ (const char FAR *, long, const char FAR *, ...);
+KRB5_DLLIMP extern const char FAR * KRB5_CALLCONV error_message (long);
extern void (*com_err_hook) (const char *, long, const char *, va_list);
extern void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list)))
(const char *, long, const char *, va_list);
extern void (*reset_com_err_hook ()) (const char *, long, const char *, va_list);
#else
/* no prototypes */
-extern void INTERFACE_C com_err ();
-extern const char * INTERFACE error_message ();
+extern void com_err ();
+extern const char * error_message ();
extern void (*com_err_hook) ();
extern void (*set_com_err_hook ()) ();
extern void (*reset_com_err_hook ()) ();
};
static const char * const krc_src_prolog[] = {
- "#if defined(__STDC__) || defined(_WINDOWS)\n",
+ "#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)\n",
"#define NOARGS void\n",
"#else\n",
"#define NOARGS\n",
struct et_list * _et_list = (struct et_list *) NULL;
-const char * INTERFACE error_message (code)
+KRB5_DLLIMP const char * KRB5_CALLCONV error_message (code)
long code;
{
int offset;
int started = 0;
char *cp;
-#ifdef _WINDOWS
+#if defined(_MSDOS) || defined(_WIN32)
#define HAS_STRERROR 1
/*
** Winsock defines errors in the range 10000-10100. These are equivalent
** to 10000 plus the Berkeley error numbers.
*
* (Does windows strerror() work right here?)
+*
+* XXX NO. We need to do our own table lookup for Winsock error
+* messages!!! --- TYT
+*
*/
if (code >= 10000 && code <= 10100) /* Is it Winsock error? */
code -= 10000; /* Turn into Berkeley errno */
place here what is needed from that file. Later we may decide to do
it differently.
*/
-#ifdef _WINDOWS
-#define INTERFACE __far __export __pascal
-#define INTERFACE_C __far __export __cdecl
+#if defined(_MSDOS) || defined(_WIN32)
+#ifdef _MSDOS
+ /* Windows 16 specific */
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV __far __export __pascal
+#define KRB5_CALLCONV_C __far __export __cdecl
+#define KRB5_DLLIMP
+#define INTERFACE KRB5_CALLCONV
+#define INTERFACE_C KRB5_CALLCONV_C
+#endif
+
+#ifndef FAR
+#define FAR __far
+#define NEAR __near
+#endif
+#else
+ /* Windows 32 specific */
+#ifdef KRB5_DLL_FILE
+#define KRB5_DECLSPEC dllexport
+#else
+#define KRB5_DECLSPEC dllimport
+#endif
+
+#define KRB5_DLLIMP __declspec(KRB5_DECLSPEC)
+#define KRB5_CALLCONV __stdcall
+#define KRB5_CALLCONV_C __cdecl
+#define INTERFACE KRB5_DLLIMP KRB5_CALLCONV
+#define INTERFACE_C KRB5_DLLIMP KRB5_CALLCONV_C
+
+#endif /* Win16 vs Win32 */
+
#define sys_nerr _sys_nerr
#define sys_errlist _sys_errlist
-int __far __pascal MessageBox (void __far *, const char __far*, const char __far*, unsigned int);
+int FAR KRB5_CALLCONV MessageBox (void FAR *, const char FAR*, const char FAR*, unsigned int);
#define MB_ICONEXCLAMATION 0x0030
#else
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV
+#define KRB5_CALLCONV_C
+#define KRB5_DLLIMP
#define INTERFACE
#define INTERFACE_C
-extern int errno;
+#endif /* KRB5_CALLCONV */
#endif
+#ifndef FAR
+#define FAR
+#define NEAR
+#endif
+
+#include <errno.h>
+
struct error_table {
char const * const * msgs;
long base;
print " * This file is automatically generated; please do not edit it." > outfile
print " */" > outfile
- print "#if defined(__STDC__) || defined(_WINDOWS)" > outfile
+ print "#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)" > outfile
print "#define NOARGS void" > outfile
print "#else" > outfile
print "#define NOARGS" > outfile
extern const int sys_nerr;
#endif
-#if defined(__STDC__) && !defined(HDR_HAS_PERROR) && !defined(_WINDOWS)
+#if defined(__STDC__) && !defined(HDR_HAS_PERROR) && !defined(_MSDOS) && !defined(WIN32)
void perror (const char *);
#endif
#include <stdio.h>
#if !defined(_MACINTOSH)
-#if defined(HAVE_STDARG_H) || defined(_WINDOWS) || defined (_MACINTOSH)
+#if defined(HAVE_STDARG_H) || defined(_MSDOS) || defined(_WIN32)
#include <stdarg.h>
#else
#include <varargs.h>