Commit 16bbd13a authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Diego Casorran patches to make (lib)curl build fine on Amiga again

parent ee0666c8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@
                                  Changelog


Daniel (13 July 2005)
- Diego Casorran provided patches to make curl build fine on Amiga again.

Daniel (12 July 2005)
- Adrian Schuur added trailer support in the chunked encoding stream. The
  trailer is then sent to the normal header callback/stream. I wrote up test
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ This release includes the following changes:

This release includes the following bugfixes:

 o builds fine on AmigaOS again
 o corrected date parsing on Windows with auto-DST-adjust enabled
 o treats CONNECT 407 responses with bodies better during Digest/NTLM auth
 o improved strerror_r() API guessing when cross-compiling
@@ -44,6 +45,6 @@ advice from friends like these:

 John McGowan, Georg Wicherski, Andres Garcia, Eric Cooper, Todd Kulesza,
 Tupone Alfredo, Gisle Vanem, David Shaw, Andrew Bushnell, Dan Fandrich,
 Adrian Schuur
 Adrian Schuur, Diego Casorran

        Thanks! (and sorry if I forgot to mention someone)
+40 −15
Original line number Diff line number Diff line
@@ -22,17 +22,25 @@
 ***************************************************************************/

#include "amigaos.h"
#include <stdio.h> /* for stderr */
#include <amitcp/socketbasetags.h>

struct Library *SocketBase = NULL;
extern int errno, h_errno;

#ifdef __libnix__
#include <stabs.h>
void __request(const char *msg);
#else
# define __request( msg )	Printf( msg "\n\a")
#endif

void amiga_cleanup()
{
  if(SocketBase)
	if(SocketBase) {
		CloseLibrary(SocketBase);

		SocketBase = NULL;
	}
}

BOOL amiga_init()
{
@@ -40,10 +48,27 @@ BOOL amiga_init()
		SocketBase = OpenLibrary("bsdsocket.library", 4);
	
	if(!SocketBase) {
    fprintf(stderr, "No TCP/IP Stack running!\n\a");
		__request("No TCP/IP Stack running!");
		return FALSE;
	}
	
	if(SocketBaseTags(
		SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno,
//		SBTM_SETVAL(SBTC_HERRNOLONGPTR),	   (ULONG) &h_errno,
		SBTM_SETVAL(SBTC_LOGTAGPTR),		   (ULONG) "cURL",
	TAG_DONE)) {
		
		__request("SocketBaseTags ERROR");
		return FALSE;
	}
	
#ifndef __libnix__
	atexit(amiga_cleanup);
#endif
	
	return TRUE;
}

#ifdef __libnix__
ADD2EXIT(amiga_cleanup,-50);
#endif
+10 −4
Original line number Diff line number Diff line
@@ -32,13 +32,19 @@
#include <proto/exec.h>
#include <proto/dos.h>

#include <bsdsocket.h>
#include <sys/socket.h>

#include "config-amigaos.h"

#ifndef select
# define select(args...) WaitSelect( args, NULL)
#endif
#ifndef inet_ntoa
# define inet_ntoa(x)    Inet_NtoA( x ## .s_addr)
#endif
#ifndef ioctl
# define ioctl(a,b,c,d)  IoctlSocket( (LONG)a, (ULONG)b, (char*)c)
#endif
#define _AMIGASF        1

extern void amiga_cleanup();
+4 −1
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@
#define HAVE_UTIME_H 1
#define HAVE_WRITABLE_ARGV 1
#define HAVE_ZLIB_H 1
#define HAVE_SYS_IOCTL_H 1

#define USE_OPENSSL 1
#define USE_SSLEAY 1
@@ -80,7 +81,9 @@
#define TIME_WITH_SYS_TIME 1

#define in_addr_t int
#ifndef socklen_t
# define socklen_t int
#endif

#ifndef O_RDONLY
# define O_RDONLY 0x0000
Loading