summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1996-06-12 05:32:06 +0000
committerTheodore Tso <tytso@mit.edu>1996-06-12 05:32:06 +0000
commit1c3b7e89e18a1c8ed325fb4c465e06b2d26bb222 (patch)
tree882ffdd8ecef73921e52a805afa49a2eef61d9fe
parent9ea5441a9f42a441060d05cd1373bcd99804397b (diff)
downloadkrb5-1c3b7e89e18a1c8ed325fb4c465e06b2d26bb222.tar.gz
krb5-1c3b7e89e18a1c8ed325fb4c465e06b2d26bb222.tar.xz
krb5-1c3b7e89e18a1c8ed325fb4c465e06b2d26bb222.zip
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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8319 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/util/et/ChangeLog12
-rw-r--r--src/util/et/com_err.c18
-rw-r--r--src/util/et/com_err.h55
-rw-r--r--src/util/et/compile_et.c2
-rw-r--r--src/util/et/error_message.c8
-rw-r--r--src/util/et/error_table.h49
-rw-r--r--src/util/et/et_c.awk2
-rw-r--r--src/util/et/internal.h2
-rw-r--r--src/util/et/vfprintf.c2
9 files changed, 120 insertions, 30 deletions
diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog
index 052c4de151..8b4f900e5b 100644
--- a/src/util/et/ChangeLog
+++ b/src/util/et/ChangeLog
@@ -1,3 +1,15 @@
+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
diff --git a/src/util/et/com_err.c b/src/util/et/com_err.c
index 8990e770f2..e0e5baf89b 100644
--- a/src/util/et/com_err.c
+++ b/src/util/et/com_err.c
@@ -8,7 +8,7 @@
#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>
@@ -39,14 +39,14 @@
* 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)
@@ -70,7 +70,7 @@ static void
if (fmt) {
vsprintf (errbuf + strlen (errbuf), fmt, args);
}
-#ifdef _WINDOWS
+#if defined(_MSDOS) || defined(_WIN32)
MessageBox (NULL, errbuf, "Kerboros", MB_ICONEXCLAMATION);
#else
#ifdef _MACINTOSH
@@ -155,7 +155,7 @@ Boolean done;
#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) ();
@@ -173,12 +173,12 @@ void com_err_va (whoami, code, fmt, args)
}
#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;
diff --git a/src/util/et/com_err.h b/src/util/et/com_err.h
index 31a5f9027f..5d6db0725f 100644
--- a/src/util/et/com_err.h
+++ b/src/util/et/com_err.h
@@ -29,31 +29,66 @@
* 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 ()) ();
diff --git a/src/util/et/compile_et.c b/src/util/et/compile_et.c
index 921aad2400..d42c274337 100644
--- a/src/util/et/compile_et.c
+++ b/src/util/et/compile_et.c
@@ -76,7 +76,7 @@ static const char * const c_src_prolog[] = {
};
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",
diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c
index 906b935c50..88997b91a7 100644
--- a/src/util/et/error_message.c
+++ b/src/util/et/error_message.c
@@ -28,7 +28,7 @@ static char buffer[25];
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;
@@ -38,13 +38,17 @@ long code;
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 */
diff --git a/src/util/et/error_table.h b/src/util/et/error_table.h
index a82b39c1fc..d617912449 100644
--- a/src/util/et/error_table.h
+++ b/src/util/et/error_table.h
@@ -12,19 +12,58 @@
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;
diff --git a/src/util/et/et_c.awk b/src/util/et/et_c.awk
index 376a8d6536..8067e71905 100644
--- a/src/util/et/et_c.awk
+++ b/src/util/et/et_c.awk
@@ -109,7 +109,7 @@ c2n["_"]=63
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
diff --git a/src/util/et/internal.h b/src/util/et/internal.h
index 9cf55c8d42..f0c0e57234 100644
--- a/src/util/et/internal.h
+++ b/src/util/et/internal.h
@@ -10,6 +10,6 @@ extern char const * const sys_errlist[];
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
diff --git a/src/util/et/vfprintf.c b/src/util/et/vfprintf.c
index 328d882a05..48b3a40c01 100644
--- a/src/util/et/vfprintf.c
+++ b/src/util/et/vfprintf.c
@@ -19,7 +19,7 @@
#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>