Ignore:
Timestamp:
04/08/06 16:23:04 (16 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_helper.c

    r6b2d5ed r23971d0  
    3939#include <string.h>
    4040#include <errno.h>
    41 #ifdef HAVE_INTTYPES_H
    42 #  include <inttypes.h>
    43 #else
    44 #  error "Can't find inttypes.h - this needs to be fixed"
    45 #endif
    4641#include  "format_helper.h"
    4742
     
    4944#include <assert.h>
    5045#include <stdarg.h>
     46
     47#ifdef WIN32
     48#  include <io.h>
     49#  include <share.h>
     50#  define snprintf sprintf_s
     51
     52struct libtrace_eventobj_t trace_event_device(struct libtrace_t *trace, struct libtrace_packet_t *packet) {
     53    struct libtrace_eventobj_t event = {0,0,0.0,0};
     54
     55    trace_set_err(trace,TRACE_ERR_OPTION_UNAVAIL, "trace_event() is not "
     56            "supported on devices under windows in this version");
     57
     58    event.type = TRACE_EVENT_TERMINATE;
     59    return event;
     60}
     61#else
     62#  include <sys/ioctl.h>
    5163
    5264struct libtrace_eventobj_t trace_event_device(struct libtrace_t *trace, struct libtrace_packet_t *packet) {
     
    7587        return event;
    7688}
     89#endif
    7790
    7891struct libtrace_eventobj_t trace_event_trace(struct libtrace_t *trace, struct libtrace_packet_t *packet) {
Note: See TracChangeset for help on using the changeset viewer.