Ignore:
Timestamp:
Sep 22, 2010, 9:47:56 PM (10 years ago)
Author:
Sam Hocevar
Message:

Fix zzat compilation on Win32 and create a .vcxproj file for it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/zzat.c

    r4376 r4653  
    2525/* Needed for getc_unlocked() on OpenSolaris */
    2626#define __EXTENSIONS__
     27
     28#if defined _MSC_VER
     29#   include <io.h>
     30typedef int ssize_t;
     31#   define snprintf sprintf_s
     32#   define close _close
     33#endif
    2734
    2835#if defined HAVE_STDINT_H
     
    136143            break;
    137144        case 'r': /* --repeat */
    138             repeat = atoi(optarg);
     145            repeat = atoi(myoptarg);
    139146            break;
    140147        case 's': /* --squeeze-blank */
     
    371378}
    372379
    373 #define PARSECMD(fmt, arg...) \
     380#define PARSECMD(fmt, ...) \
    374381    (make_fmt(&parser, fmt) == sscanf(sequence, parser.tmpfmt, \
    375                                       ##arg, &parser.ch) \
     382                                      __VA_ARGS__, &parser.ch) \
    376383         && parser.ch == parser.lastch)
    377384
     
    578585#endif
    579586        else if (PARSECMD("rewind ( )"))
    580             MY_FSEEK(rewind(f), -retlen);
     587            MY_FSEEK(rewind(f), -(int)retlen);
    581588        else if (PARSECMD("ungetc ( )"))
    582589            MY_FSEEK(if(retoff) ungetc((unsigned char)retbuf[retoff - 1], f),
Note: See TracChangeset for help on using the changeset viewer.