kosma / minmea

a lightweight GPS NMEA 0183 parser library in pure C
Do What The F*ck You Want To Public License
755 stars 246 forks source link

Compiling under MSVC2013 #26

Closed JodiTheTigger closed 6 years ago

JodiTheTigger commented 6 years ago

Heya,

I hacked minmea.h so I could build this under MSVC2013.

Just posting my code snippet (at the top of minmea.h) in-case anyone else wants to do the same.

// ...

#ifdef __cplusplus
extern "C" {
#endif

#if defined(_MSC_VER)
#if !defined(HAVE_STRUCT_TIMESPEC)
struct timespec {
    time_t          tv_sec;
    long            tv_nsec;
};
#endif

#define inline __inline
#define timegm _mkgmtime

#endif

#include <stdio.h>
#include <stdint.h>

// ...
kosma commented 6 years ago

I'll separate those into a compatibility module so others can benefit.

(also I can't believe MSVC still doesn't know about "inline". talk about Microsoft slowing down progress in the computer world...)

kosma commented 6 years ago

Included in 0b02771. Thanks!