Modifications and bug-fixes to make Mosaic compile and run under UNICOS. (part 2)
The changes mostly revolve around: - Type changes and casts to make the picky C-compiler happy - Fixed bug in XmxExtractToken where it would not zero out bits 16-31 on a non-32-bit system - Added back old getline implementation as its missing on UNICOS - Added some missing typedefs and conditional directives to turn on the relevant code pieces for UNICOS
This commit is contained in:

committed by
Robert Clausecker

parent
075b2e4911
commit
8baf5f2e62
@@ -64,6 +64,10 @@
|
||||
#include "../src/gui.h"
|
||||
#include "../src/gui-dialogs.h"
|
||||
|
||||
#ifdef _UNICOS
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
#ifndef MAXHOSTNAMELEN
|
||||
#define MAXHOSTNAMELEN 64 /* Arbitrary limit */
|
||||
#endif
|
||||
|
@@ -491,27 +491,29 @@ PUBLIC void HTFileInit NOARGS
|
||||
|
||||
#define MAX_STRING_LEN 256
|
||||
|
||||
/*static int getline(char *s, int n, FILE *f) */
|
||||
/*{*/
|
||||
/*register int i=0;*/
|
||||
#ifdef _UNICOS
|
||||
static int getline(char **ps, size_t *pn, FILE *f)
|
||||
{
|
||||
register int i=0;
|
||||
char *s = *ps;
|
||||
|
||||
/*while(1) */
|
||||
/*{*/
|
||||
/*s[i] = (char)fgetc(f);*/
|
||||
while(1)
|
||||
{
|
||||
s[i] = (char)fgetc(f);
|
||||
|
||||
/*if(s[i] == CR)*/
|
||||
/*s[i] = fgetc(f);*/
|
||||
if(s[i] == CR)
|
||||
s[i] = fgetc(f);
|
||||
|
||||
/*if((s[i] == EOF) || (s[i] == LF) || (i == (n-1)))*/
|
||||
/*{*/
|
||||
/*s[i] = '\0';*/
|
||||
/*return (feof(f) ? 1 : 0);*/
|
||||
/*}*/
|
||||
/*++i;*/
|
||||
/*}*/
|
||||
|
||||
/**//* NOTREACHED */
|
||||
/*}*/
|
||||
if((s[i] == EOF) || (s[i] == LF) || (i == (*pn-1)))
|
||||
{
|
||||
s[i] = '\0';
|
||||
return (feof(f) ? 1 : 0);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
#endif
|
||||
|
||||
static void getword(char *word, char *line, char stop, char stop2)
|
||||
{
|
||||
|
@@ -68,6 +68,10 @@ typedef struct sockaddr_in SockA; /* See netinet/in.h */
|
||||
#define unix
|
||||
#endif
|
||||
|
||||
#ifdef _UNICOS
|
||||
#define USE_DIRENT
|
||||
#endif
|
||||
|
||||
#ifdef _IBMR2
|
||||
#define USE_DIRENT /* sys V style directory open */
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user