From ece8568526599562201b6ac73b53fc0e44fb15b1 Mon Sep 17 00:00:00 2001 From: mquinson Date: Fri, 10 Dec 2004 06:48:38 +0000 Subject: [PATCH] Initiate win32 cross-port git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@591 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/gras/Transport/rl_transport.c | 8 +----- src/gras/Transport/transport_plugin_buf.c | 13 +++++----- src/gras/Transport/transport_plugin_file.c | 17 +++++++------ src/gras/Transport/transport_plugin_tcp.c | 29 +++++++++++++--------- 4 files changed, 35 insertions(+), 32 deletions(-) diff --git a/src/gras/Transport/rl_transport.c b/src/gras/Transport/rl_transport.c index da21e4d590..61331b5cc8 100644 --- a/src/gras/Transport/rl_transport.c +++ b/src/gras/Transport/rl_transport.c @@ -7,17 +7,11 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include -#include /* struct timeval */ -#include -#include - +#include "portable.h" #include "gras/Transport/transport_private.h" XBT_LOG_EXTERNAL_CATEGORY(transport); XBT_LOG_DEFAULT_CATEGORY(transport); - - /** * gras_trp_select: * diff --git a/src/gras/Transport/transport_plugin_buf.c b/src/gras/Transport/transport_plugin_buf.c index 9b0cc6a100..d241153fe8 100644 --- a/src/gras/Transport/transport_plugin_buf.c +++ b/src/gras/Transport/transport_plugin_buf.c @@ -7,11 +7,12 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include /* htonl/ntohl */ #include #include /* memset */ +#include "portable.h" #include "xbt/misc.h" +#include "xbt/sysdep.h" #include "transport_private.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(trp_buf,transport, @@ -52,7 +53,7 @@ typedef struct { ***/ typedef struct { - uint32_t size; + int size; char *data; int pos; /* for receive; not exchanged over the net */ } gras_trp_buf_t; @@ -236,10 +237,10 @@ gras_trp_buf_chunk_recv(gras_socket_t sock, long int thissize; if (data->in.size == data->in.pos) { /* out of data. Get more */ - uint32_t nextsize; + int nextsize; DEBUG0("Recv the size"); TRY(super->chunk_recv(sock,(char*)&nextsize, 4)); - data->in.size = ntohl(nextsize); + data->in.size = (int)ntohl(nextsize); VERB1("Recv the chunk (size=%d)",data->in.size); TRY(super->chunk_recv(sock, data->in.data, data->in.size)); @@ -270,12 +271,12 @@ gras_trp_buf_chunk_recv(gras_socket_t sock, xbt_error_t gras_trp_buf_flush(gras_socket_t sock) { xbt_error_t errcode; - uint32_t size; + int size; gras_trp_plugin_t *super=((gras_trp_buf_plug_data_t*)sock->plugin->data)->super; gras_trp_bufdata_t *data=sock->bufdata; XBT_IN; - size = htonl(data->out.size); + size = (int)htonl(data->out.size); DEBUG1("Send the size (=%d)",data->out.size); TRY(super->chunk_send(sock,(char*) &size, 4)); diff --git a/src/gras/Transport/transport_plugin_file.c b/src/gras/Transport/transport_plugin_file.c index 5386e8e859..7e7260ed8b 100644 --- a/src/gras/Transport/transport_plugin_file.c +++ b/src/gras/Transport/transport_plugin_file.c @@ -7,15 +7,18 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include -#include -#include -#include -#include -#include - +#include "portable.h" #include "transport_private.h" +#if 0 +# include +# include +# include +# include +# include +# include +#endif + XBT_LOG_NEW_DEFAULT_SUBCATEGORY(trp_file,transport, "Pseudo-transport to write to/read from a file"); diff --git a/src/gras/Transport/transport_plugin_tcp.c b/src/gras/Transport/transport_plugin_tcp.c index 55bd596073..753296fe39 100644 --- a/src/gras/Transport/transport_plugin_tcp.c +++ b/src/gras/Transport/transport_plugin_tcp.c @@ -7,18 +7,23 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include /* close() pipe() read() write() */ -#include /* close() pipe() read() write() */ -#include /* sometimes required for #include */ -#include /* TCP_NODELAY */ -#include /* inet_ntoa() */ -#include /* getprotobyname() */ -#include /* struct timeval */ -#include /* errno */ -#include /* waitpid() */ -#include /* getpeername() socket() */ -#include -#include /* memset */ +#include "portable.h" + +#if 0 +# include /* close() pipe() read() write() */ +# include /* close() pipe() read() write() */ +# include /* sometimes required for #include */ +# include /* TCP_NODELAY */ +# include /* inet_ntoa() */ +# include /* getprotobyname() */ +# include /* struct timeval */ +# include /* errno */ +# include /* waitpid() */ +# include /* getpeername() socket() */ +# include +# include /* memset */ +#endif + #include "transport_private.h" -- 2.20.1