Skip to content

Commit

Permalink
Gets pe_utils.c to compile with VS2015. (#488)
Browse files Browse the repository at this point in the history
* Visual Studio 2015 (_MSC_VER == 1900) defines the snprintf function, so avoid defining it in those cases.

* Adds missing include (for 'sprintf').

* Gets pe_utils.c to compile with VS2015.
  • Loading branch information
macourteau authored and plusvic committed Aug 2, 2016
1 parent ab6d748 commit 7473441
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions libyara/modules/pe_utils.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@


#if !HAVE_TIMEGM

#include <time.h>
#include <stdio.h>

#include <yara/mem.h>
#include <yara/integers.h>

#if defined(WIN32)
#include <string.h>
#define strncasecmp _strnicmp
#define timegm _mkgmtime
#endif

#if !HAVE_TIMEGM && !defined(WIN32)

#include <time.h>

static int is_leap(
unsigned int year)
{
Expand Down

0 comments on commit 7473441

Please sign in to comment.