From 0c969f9e347bf4d04ca236b858ecb2d3abc0884c Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 7 Jun 1996 22:20:29 +0000 Subject: [PATCH] Beginnings of Win-32 support git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8276 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 5 ++++ src/include/k5-int.h | 70 +++++++++++++++++++++++++++---------------- src/include/krb5.hin | 35 ++++++++++++++++++---- 3 files changed, 80 insertions(+), 30 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index f66c8ec27..2f842b969 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,8 @@ +Fri Jun 7 18:13:33 1996 Theodore Y. Ts'o + + * krb5.hin: + * k5-int.h: Beginnings of Win-32 support. + Thu Jun 6 14:14:28 1996 Theodore Y. Ts'o * krb5.hin (krb5_cc_get_type): Remove extraneous '*' from definition. diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 825a49b6e..99d23fd5a 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -54,21 +54,61 @@ #ifndef KRB5_CONFIG__ #define KRB5_CONFIG__ -#ifdef _MSDOS +#if (defined(_MSDOS) || defined(_WIN32)) /* * Machine-type definitions: PC Clone 386 running Microloss Windows */ +#if defined(_MSDOS) + /* Windows 16 specific */ +#define BITS16 +#define SIZEOF_INT 2 +#define SIZEOF_SHORT 2 +#define SIZEOF_LONG 4 + +#ifndef INTERFACE +#define INTERFACE __far __export __pascal +#define INTERFACE_C __far __export __cdecl +#endif + +/* + * The following defines are needed to make work + * in stdc mode (/Za flag). Winsock.h needs . + */ +#define FAR _far +#define NEAR _near +#define _far __far +#define _near __near +#define _pascal __pascal +#define _cdecl __cdecl +#define _huge __huge + +#ifdef NEED_WINDOWS +#include +#endif + +#else + /* Windows 32 specific */ +#define SIZEOF_INT 4 +#define SIZEOF_SHORT 2 +#define SIZEOF_LONG 4 + +#ifndef INTERFACE +#define INTERFACE __declspec(__dllexport) __stdcall +#define INTERFACE_C __declspec(__dllexport) __cdecl +#endif + +#define FAR +#define NEAR + +#endif + /* Kerberos Windows initialization file */ #define KERBEROS_INI "kerberos.ini" #define INI_FILES "Files" #define INI_KRB_CCACHE "krb5cc" /* Location of the ccache */ #define INI_KRB5_CONF "krb5.ini" /* Location of krb5.conf file */ -#define BITS16 -#define SIZEOF_INT 2 -#define SIZEOF_SHORT 2 -#define SIZEOF_LONG 4 #define MAXHOSTNAMELEN 512 #define MAXPATHLEN 256 /* Also for Windows temp files */ @@ -116,26 +156,6 @@ typedef unsigned short u_short; typedef unsigned char u_char; #endif /* KRB5_SYSTYPES__ */ -#ifndef INTERFACE -#define INTERFACE __far __export __pascal -#define INTERFACE_C __far __export __cdecl -#endif - -/* - * The following defines are needed to make work - * in stdc mode (/Za flag). Winsock.h needs . - */ -#define FAR _far -#define NEAR _near -#define _far __far -#define _near __near -#define _pascal __pascal -#define _cdecl __cdecl -#define _huge __huge - -#ifdef NEED_WINDOWS -#include -#endif #ifdef NEED_LOWLEVEL_IO /* Ugly. Microsoft, in stdc mode, doesn't support the low-level i/o diff --git a/src/include/krb5.hin b/src/include/krb5.hin index b99807e2a..e89f96c74 100644 --- a/src/include/krb5.hin +++ b/src/include/krb5.hin @@ -27,21 +27,46 @@ #ifndef KRB5_GENERAL__ #define KRB5_GENERAL__ -#ifdef _MSDOS +#if (defined(_MSDOS) || defined(_WIN32)) +#if defined(_MSDOS) /* Win 16 vs. Win32 */ + + /* Windows 16 specific */ #define SIZEOF_INT 2 #define SIZEOF_LONG 4 -#ifndef KRB5_CONFIG__ -#define KRB5_PROVIDE_PROTOTYPES -#define HAS_VOID_TYPE -#define HAVE_STDARG_H #ifndef INTERFACE #define INTERFACE __far __export __pascal #define INTERFACE_C __far __export __cdecl #endif /* !INTERFACE */ + #define FAR _far #define NEAR _near + +#else /* Windows 32 specific */ + +#define SIZEOF_INT 4 +#define SIZEOF_LONG 4 + +/* + * If the interface functions haven't been defined, then we + * must be *importing* them as a consumer, not *exporting* them + * as a DLL function. + */ +#ifndef INTERFACE +#define INTERFACE __declspec(__dllimport) __stdcall +#define INTERFACE_C __declspec(__dllimport) __cdecl +#endif + +#define FAR +#define NEAR + +#endif /* Win 16 vs Win32 */ + +#ifndef KRB5_CONFIG__ +#define KRB5_PROVIDE_PROTOTYPES +#define HAS_VOID_TYPE +#define HAVE_STDARG_H #ifndef _SIZE_T_DEFINED typedef unsigned int size_t; #define _SIZE_T_DEFINED -- 2.26.2