Changeset 33e1501 for lib/format_rt.c


Ignore:
Timestamp:
04/08/06 16:31:40 (15 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
689c220
Parents:
23971d0
Message:

WIN32 compile fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_rt.c

    r68155f1 r33e1501  
    4040#include "rt_protocol.h"
    4141
    42 #ifdef HAVE_INTTYPES_H
    43 #  include <inttypes.h>
    44 #else
    45 #  error "Can't find inttypes.h - this needs to be fixed"
    46 #endif
    47 
    48 #ifdef HAVE_STDDEF_H
    49 #  include <stddef.h>
    50 #else
    51 # error "Can't find stddef.h - do you define ptrdiff_t elsewhere?"
    52 #endif
    53 #include <sys/types.h>
    54 #include <sys/socket.h>
    55 #include <sys/un.h>
    56 #include <sys/mman.h>
    5742#include <sys/stat.h>
    58 #include <unistd.h>
    5943#include <assert.h>
    6044#include <errno.h>
    61 #include <netdb.h>
    6245#include <fcntl.h>
    6346#include <stdio.h>
    6447#include <string.h>
    6548#include <stdlib.h>
     49
     50#ifndef WIN32
     51# include <netdb.h>
     52#endif
    6653
    6754#define RT_INFO ((struct rt_format_data_t*)libtrace->format_data)
     
    114101        rt_hello_t hello_opts;
    115102        uint8_t reason;
    116         int oldflags;
    117 
    118103       
    119104        if ((he=gethostbyname(RT_INFO->hostname)) == NULL) {
     
    129114        remote.sin_port = htons(RT_INFO->port);
    130115        remote.sin_addr = *((struct in_addr *)he->h_addr);
    131         bzero(&(remote.sin_zero), 8);
     116        memset(&(remote.sin_zero), 0, 8);
    132117
    133118        if (connect(RT_INFO->input_fd, (struct sockaddr *)&remote,
     
    286271static int rt_read(struct libtrace_t *libtrace, void **buffer, size_t len, int block) {
    287272        int numbytes;
    288         int i;
    289273        char *buf_ptr;
    290274
     
    296280                RT_INFO->buf_left = 0;
    297281        }
     282
     283#ifndef MSG_DONTWAIT
     284#define MSG_DONTWAIT 0
     285#endif
    298286
    299287        if (block)
     
    674662};
    675663
    676 void __attribute__((constructor)) rt_constructor() {
     664void CONSTRUCTOR rt_constructor() {
    677665        register_format(&rt);
    678666}
Note: See TracChangeset for help on using the changeset viewer.