Changeset 33e1501 for lib/format_wag.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_wag.c

    rc7658ea r33e1501  
    3737#include "wag.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 <time.h>
    52 #include <sys/socket.h>
    53 #include <sys/un.h>
    54 #include <sys/mman.h>
    5539#include <sys/stat.h>
    5640#include <fcntl.h>
    57 #include <unistd.h>
    5841#include <assert.h>
    5942#include <errno.h>
    60 #include <netdb.h>
    6143#include <stdio.h>
    6244#include <string.h>
     
    6951#ifdef HAVE_SYS_LIMITS_H
    7052#  include <sys/limits.h>
     53#endif
     54
     55#ifdef WIN32
     56#  include <io.h>
     57#  include <share.h>
    7158#endif
    7259
     
    123110                return -1;
    124111        }
     112#ifndef WIN32
    125113        if (S_ISCHR(buf.st_mode)) {
    126114                INPUT.fd = open(libtrace->uridata, O_RDONLY);
    127         } else {
    128                 trace_set_err(libtrace,TRACE_ERR_INIT_FAILED,
    129                                 "%s is not a valid char device",
    130                                 libtrace->uridata);
    131                 return -1;
    132         }
    133         return 0;
     115                return 0;
     116        }
     117#endif
     118        trace_set_err(libtrace,TRACE_ERR_INIT_FAILED,
     119                        "%s is not a valid char device",
     120                        libtrace->uridata);
     121        return -1;
    134122}
    135123
     
    379367}
    380368
    381 static libtrace_linktype_t wag_get_link_type(const struct libtrace_packet_t *packet __attribute__((unused))) {
     369static libtrace_linktype_t wag_get_link_type(const struct libtrace_packet_t *packet UNUSED) {
    382370        return TRACE_TYPE_80211;
    383371}
     
    517505
    518506
    519 void __attribute__((constructor)) wag_constructor() {
     507void CONSTRUCTOR wag_constructor() {
    520508        register_format(&wag);
    521509        register_format(&wag_trace);
Note: See TracChangeset for help on using the changeset viewer.