Changeset 23971d0 for lib/format_erf.c


Ignore:
Timestamp:
04/08/06 16:23:04 (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:
33e1501
Parents:
9ee7134
Message:

Portability fixes for windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r6b2d5ed r23971d0  
    3737#include "parse_cmd.h"
    3838
    39 #ifdef HAVE_INTTYPES_H
    40 #  include <inttypes.h>
    41 #else
    42 #  error "Can't find inttypes.h - this needs to be fixed"
    43 #endif
    44 
    45 #ifdef HAVE_STDDEF_H
    46 #  include <stddef.h>
    47 #else
    48 # error "Can't find stddef.h - do you define ptrdiff_t elsewhere?"
    49 #endif
    50 #include <sys/types.h>
    51 #include <sys/socket.h>
    52 #include <sys/un.h>
    53 #include <sys/mman.h>
    54 #include <sys/stat.h>
    55 #include <unistd.h>
    5639#include <assert.h>
    5740#include <errno.h>
    58 #include <netdb.h>
    5941#include <fcntl.h>
    6042#include <stdio.h>
    6143#include <string.h>
    6244#include <stdlib.h>
     45
     46#ifdef WIN32
     47#  include <io.h>
     48#  include <share.h>
     49#  define PATH_MAX _MAX_PATH
     50#  define snprintf sprintf_s
     51#else
     52#  include <netdb.h>
     53#endif
    6354
    6455
     
    373364        remote.sin_port = htons(CONNINFO.rt.port);
    374365        remote.sin_addr = *((struct in_addr *)he->h_addr);
    375         bzero(&(remote.sin_zero), 8);
     366        memset(&(remote.sin_zero), 0, 8);
    376367
    377368        if (connect(INPUT.fd, (struct sockaddr *)&remote,
     
    10141005};
    10151006
    1016 void __attribute__((constructor)) erf_constructor() {
     1007void CONSTRUCTOR erf_constructor() {
    10171008        register_format(&rtclient);
    10181009        register_format(&erf);
Note: See TracChangeset for help on using the changeset viewer.