Skip to content

Commit a1572fb

Browse files
authored
Xenix version (#22)
* Narrowed scope of SCO Unix defines Made sure OpenServer is excluded, as it was reported to be working already * Converted C++ comments * Converted MORE C++ comments Including the one _I_ introduced :) * First version that compiles on Xenix However it doesn't want to do much besides printing a string... Also, need better checks to restrict to Xenix only, currently it might break/be suboptimal for ODT & later SCO Unices * More specific xenix defines - The previous commit was already a working copy, if you don't mangle your resolv.conf... - however, it only works for http :| Core dumps on https * Fixed segfault with https
1 parent 81a934e commit a1572fb

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

carl.c

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#include <stdio.h>
88
#include <sys/time.h>
99
#include <sys/types.h>
10+
#if defined (M_XENIX) && !defined(M_UNIX)
11+
#include <sys/types.tcp.h>
12+
#endif
1013
#include <sys/socket.h>
1114
#if !defined (M_XENIX) || defined(_SCO_DS) /* On SCO Unix the next line crashes gcc, but on OpenServer it might work/be needed? */
1215
#if !defined(__AUX__) && !defined(__AMIGA__) && (!defined(NS_TARGET_MAJOR) || (NS_TARGET_MAJOR > 3)) && !defined(__MACHTEN_68K__) && !defined(__sun) && !defined(__BEOS__) && (!defined(__hppa) && !defined(__hpux)) && !defined(macintosh)

cryanc.c

+34-5
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,42 @@ typedef unsigned long long u_int64_t;
210210
#endif
211211
#endif
212212

213-
/* SCO Unix 4.2 (pre-OpenServer)*/
213+
/* SCO Xenix and Unix 4.2 (pre-OpenServer)*/
214214
#if defined (M_XENIX) && !defined(_SCO_DS)
215+
216+
#if !defined(M_UNIX) /* Xenix 2.3.4 */
217+
#warning compiling for SCO Xenix
218+
#include <stddef.h>
219+
220+
/* Xenix's realloc is also weird */
221+
char *_crealloc(void *p, unsigned s) { return (p) ? realloc(p,s) : malloc(s); }
222+
#define TLS_REALLOC(p,s) _crealloc(p,s)
223+
#define XREALLOC _crealloc
224+
225+
/*from https://www.samba.org/WinFS_report/winfs_dev/sun/solaris/source/2.50a/replace.c */
226+
char *strstr(char *s, char *p)
227+
{
228+
int len = strlen(p);
229+
230+
while ( *s != '\0' ) {
231+
if ( strncmp(s, p, len) == 0 )
232+
return s;
233+
s++;
234+
}
235+
236+
return NULL;
237+
}
238+
239+
#define memmove(d,s,l) (bcopy((char *)(s),(char *)(d),(l)))
240+
#else
215241
#warning compiling for SCO Unix
242+
#endif /* Xenix 2.3.4 */
243+
244+
#define LTC_NO_PROTOTYPES
216245
#define NOT_POSIX 1
217246
#include <sys/types.h>
218247
#include <stdarg.h>
248+
219249
int usleep(unsigned int useconds)
220250
{
221251
struct timeval temptval;
@@ -230,7 +260,7 @@ int usleep(unsigned int useconds)
230260
}
231261
}
232262

233-
#endif
263+
#endif /* SCO Xenix, Unix, ODT */
234264

235265
/* Distinguish NeXTSTEP/OpenSTEP from Rhapsody and from Mac OS X */
236266
#if defined(__MACH__)
@@ -17007,9 +17037,8 @@ int der_printable_value_decode(int v);
1700717037
/* UTF-8 */
1700817038
#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined (__WCHAR_TYPE__)) && !defined(LTC_NO_WCHAR)
1700917039
#include <wchar.h>
17010-
#else
17011-
/* Don't define on platforms that predefine it. */
17012-
#if !defined(_WCHAR_H) && !defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) && !defined(__WCHAR_TYPE__) && !defined(_WCHAR_T) && !defined(__WCHARTDEF__)
17040+
#else
17041+
#if !defined(_WCHAR_H) && !defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) && !defined(__WCHAR_TYPE__) && !defined(_WCHAR_T) && !defined(__WCHARTDEF__)
1701317042
typedef ulong32 wchar_t;
1701417043
#endif
1701517044
#endif

0 commit comments

Comments
 (0)