minor patches to enable building for NetWare CLIB.
sent by Dmitry Mityugov.
This commit is contained in:
parent
3fc6faf1ae
commit
afdfa4bed2
@ -59,10 +59,13 @@
|
|||||||
#include <stdlib.h> /* required for free() prototype, without it, this crashes */
|
#include <stdlib.h> /* required for free() prototype, without it, this crashes */
|
||||||
#endif /* on macos 68K */
|
#endif /* on macos 68K */
|
||||||
|
|
||||||
#if (defined(HAVE_FIONBIO) && defined(__NOVELL_LIBC__))
|
#if (defined(HAVE_FIONBIO) && defined(NETWARE))
|
||||||
#include <sys/filio.h>
|
#include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
#ifdef NETWARE
|
||||||
|
#ifndef __NOVELL_LIBC__
|
||||||
|
NETDB_DEFINE_CONTEXT
|
||||||
|
#endif
|
||||||
#undef in_addr_t
|
#undef in_addr_t
|
||||||
#define in_addr_t unsigned long
|
#define in_addr_t unsigned long
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,9 +26,9 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
|
||||||
#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
#ifdef NETWARE
|
||||||
#undef in_addr_t
|
#undef in_addr_t
|
||||||
#define in_addr_t uint32_t
|
#define in_addr_t unsigned long
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -284,7 +284,12 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
* which the gethostbyname() is the preferred() function.
|
* which the gethostbyname() is the preferred() function.
|
||||||
*/
|
*/
|
||||||
else {
|
else {
|
||||||
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
|
NETDB_DEFINE_CONTEXT
|
||||||
|
h = gethostbyname((char*)hostname);
|
||||||
|
#else
|
||||||
h = gethostbyname(hostname);
|
h = gethostbyname(hostname);
|
||||||
|
#endif
|
||||||
if (!h)
|
if (!h)
|
||||||
infof(conn->data, "gethostbyname(2) failed for %s\n", hostname);
|
infof(conn->data, "gethostbyname(2) failed for %s\n", hostname);
|
||||||
#endif /*HAVE_GETHOSTBYNAME_R */
|
#endif /*HAVE_GETHOSTBYNAME_R */
|
||||||
|
@ -42,6 +42,10 @@
|
|||||||
|
|
||||||
#include "inet_ntop.h"
|
#include "inet_ntop.h"
|
||||||
|
|
||||||
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
|
NETINET_DEFINE_CONTEXT
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
|
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
|
||||||
/* this platform has a inet_ntoa_r() function, but no proto declared anywhere
|
/* this platform has a inet_ntoa_r() function, but no proto declared anywhere
|
||||||
so we include our own proto to make compilers happy */
|
so we include our own proto to make compilers happy */
|
||||||
|
@ -68,6 +68,9 @@ static int gettimeofday(struct timeval *tp, void *nothing)
|
|||||||
}
|
}
|
||||||
#else /* WIN32 */
|
#else /* WIN32 */
|
||||||
/* non-win32 version of Curl_gettimeofday() */
|
/* non-win32 version of Curl_gettimeofday() */
|
||||||
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
|
#include <sys/timeval.h>
|
||||||
|
#endif
|
||||||
static int gettimeofday(struct timeval *tp, void *nothing)
|
static int gettimeofday(struct timeval *tp, void *nothing)
|
||||||
{
|
{
|
||||||
(void)nothing; /* we don't support specific time-zones */
|
(void)nothing; /* we don't support specific time-zones */
|
||||||
|
@ -70,6 +70,9 @@ static int gettimeofday(struct timeval *tp, void *nothing)
|
|||||||
}
|
}
|
||||||
#else /* WIN32 */
|
#else /* WIN32 */
|
||||||
/* non-win32 version of Curl_gettimeofday() */
|
/* non-win32 version of Curl_gettimeofday() */
|
||||||
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
|
#include <sys/timeval.h>
|
||||||
|
#endif
|
||||||
static int gettimeofday(struct timeval *tp, void *nothing)
|
static int gettimeofday(struct timeval *tp, void *nothing)
|
||||||
{
|
{
|
||||||
(void)nothing; /* we don't support specific time-zones */
|
(void)nothing; /* we don't support specific time-zones */
|
||||||
|
@ -126,11 +126,31 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
|||||||
|
|
||||||
#ifdef NETWARE
|
#ifdef NETWARE
|
||||||
/* NetWare implementation */
|
/* NetWare implementation */
|
||||||
|
#ifdef __NOVELL_LIBC__
|
||||||
#include <screen.h>
|
#include <screen.h>
|
||||||
char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
return getpassword(prompt, buffer, buflen);
|
return getpassword(prompt, buffer, buflen);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#include <nwconio.h>
|
||||||
|
char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
int c;
|
||||||
|
|
||||||
|
printf("%s", prompt);
|
||||||
|
do {
|
||||||
|
c = getch();
|
||||||
|
if (c != 13) {
|
||||||
|
buffer[i] = c;
|
||||||
|
i++;
|
||||||
|
printf("%s", "*");
|
||||||
|
}
|
||||||
|
} while ((c != 13) && (i < buflen));
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
#endif /* __NOVELL_LIBC__ */
|
||||||
#define DONE
|
#define DONE
|
||||||
#endif /* NETWARE */
|
#endif /* NETWARE */
|
||||||
|
|
||||||
|
@ -47,8 +47,13 @@
|
|||||||
|
|
||||||
#define CURLseparator "--_curl_--"
|
#define CURLseparator "--_curl_--"
|
||||||
|
|
||||||
|
#ifdef NETWARE
|
||||||
#ifdef __NOVELL_LIBC__
|
#ifdef __NOVELL_LIBC__
|
||||||
#include <screen.h>
|
#include <screen.h>
|
||||||
|
#else
|
||||||
|
#include <nwconio.h>
|
||||||
|
#define mkdir mkdir_510
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@ -731,7 +736,7 @@ static void help(void)
|
|||||||
};
|
};
|
||||||
for(i=0; helptext[i]; i++) {
|
for(i=0; helptext[i]; i++) {
|
||||||
puts(helptext[i]);
|
puts(helptext[i]);
|
||||||
#ifdef __NOVELL_LIBC__
|
#ifdef NETWARE
|
||||||
if (i && ((i % 23) == 0))
|
if (i && ((i % 23) == 0))
|
||||||
pressanykey();
|
pressanykey();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user