AROS changes

This commit is contained in:
llsth 2015-08-15 08:39:25 +02:00
parent 202c38e84b
commit 0b071caa89
9 changed files with 55 additions and 26 deletions

36
src/Makefile.aros Normal file
View File

@ -0,0 +1,36 @@
# Portable Makefile generated by configure
all: fping
CC = gcc
CFLAGS = -O2 -DAROS -I. -Iinclude -Wall -Werror
LDLIBS = -lm
config.h: inet_getaddrinfo.h
touch config.h
fping.o: fping.c config.h fping.h options.h seqmap.h
fping_amiga.o: fping_amiga.c config.h
inet_getaddrinfo.o: inet_getaddrinfo.c fping.h inet_getaddrinfo.h
inet_ntop.o: inet_ntop.c
inet_pton.o: inet_pton.c
seqmap.o: seqmap.c options.h seqmap.h
socket.o: socket.c config.h fping.h
socket4.o: socket4.c config.h fping.h
fping: fping.o fping_amiga.o inet_getaddrinfo.o inet_ntop.o inet_pton.o seqmap.o socket.o socket4.o
${CC} ${CFLAGS} -s -o fping fping.o fping_amiga.o inet_getaddrinfo.o inet_ntop.o inet_pton.o seqmap.o socket.o socket4.o ${LDLIBS}
clean:
rm -f fping.o fping_amiga.o inet_getaddrinfo.o inet_ntop.o inet_pton.o seqmap.o socket.o socket4.o fping
depend:
@echo Dependencies already done

View File

@ -3,7 +3,7 @@
all: fping
CC = m68k-amigaos-gcc
CFLAGS = -O2 -noixemul -I. -I.. -Iinclude -Wall -Werror
CFLAGS = -O2 -noixemul -DAOS3 -I. -I.. -Iinclude -Wall -Werror
LDLIBS = -liberty -lm
config.h: inet_getaddrinfo.h
@ -11,7 +11,7 @@ config.h: inet_getaddrinfo.h
fping.o: fping.c config.h fping.h options.h seqmap.h
fping_amiga.o: fping_amiga.c
fping_amiga.o: fping_amiga.c config.h
inet_getaddrinfo.o: inet_getaddrinfo.c fping.h inet_getaddrinfo.h

View File

@ -6,14 +6,18 @@
#include "inet_getaddrinfo.h"
#ifdef AROS
/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef HAVE_INTTYPES_H */
# define HAVE_INTTYPES_H 1
#endif
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
#ifdef AROS
/* Define to 1 if you have the <stdint.h> header file. */
/* #undef HAVE_STDINT_H */
# define HAVE_STDINT_H 1
#endif
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

2
src/configure vendored
View File

@ -63,7 +63,7 @@ if $VALID ; then
echo ''
if [ -n "$1" ] && [ $1 = "AMIGA" ] ; then
echo 'CC = m68k-amigaos-gcc'
echo "CFLAGS = -O2 -noixemul -I. -I.. -Iinclude -Wall -Werror"
echo "CFLAGS = -O2 -noixemul -DAOS3 -I. -I.. -Iinclude -Wall -Werror"
echo "LDLIBS = -liberty -lm"
elif [ -n "$1" ] && [ $1 = "AROS" ] ; then
echo 'CC = gcc'

View File

@ -100,7 +100,10 @@ extern "C"
extern char *optarg;
extern int optind,opterr;
#ifndef AROS
extern int h_errno;
#endif
#ifdef __cplusplus
}
@ -2501,7 +2504,7 @@ select_again:
#else
slen = sizeof( FPING_SOCKADDR );
#endif
n = recvfrom( s, buf, len, 0, (struct sockaddr *)saddr, &slen );
n = recvfrom( s, buf, len, 0, (struct sockaddr *)saddr, (int*)&slen );
if( n < 0 )
errno_crash_and_burn( "recvfrom" );

View File

@ -6,8 +6,11 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#ifdef AOS3
#include <clib/exec_protos.h>
#include <clib/amitcp_protos.h>
#endif
#ifndef IPV6
#define FPING_SOCKADDR struct sockaddr_in

View File

@ -18,14 +18,17 @@
const char *vers = "\0$VER: " PACKAGE_NAME " " PACKAGE_VERSION " (15.08.2015)";
#include <unistd.h>
#ifdef AOS3
uid_t getuid () {
return 1;
}
int setuid (uid_t id) {
return 1;
}
int h_errno;
#endif
struct Library *DOSBase;
struct Library *SocketBase;

View File

@ -504,11 +504,7 @@ int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *node, socklen_
result = EAI_NONAME;
goto end;
}
#ifndef AOS3
ntoa_address = inet_ntoa(sa_in->sin_addr);
#else
ntoa_address = inet_ntoa((LONG)sa_in->sin_addr.s_addr);
#endif
if (nodelen <= strlen(ntoa_address)) {
result = EAI_OVERFLOW;
goto end;

View File

@ -191,22 +191,6 @@
#define PF_UNSPEC PF_INET
#endif
#ifdef AOS3
/*
* struct addrinfo.
*/
struct addrinfo {
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
char *ai_canonname;
struct sockaddr *ai_addr;
struct addrinfo *ai_next;
};
#endif
typedef u_int16_t in_port_t;
typedef unsigned int sa_family_t;