Skip to content

Commit

Permalink
Fix compilation under msvc
Browse files Browse the repository at this point in the history
strptime.c needs dtypes.h for strncasecmp, and _tzname instead of tzname

Use int instead of pid_t in work_baton struct for the sake of msvc

_OS_WINDOWS_ in gf.c is not defined until after including julia.h
  • Loading branch information
tkelman committed Jan 7, 2016
1 parent bc1c18e commit 9696e2b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 3 additions & 5 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#ifdef _OS_WINDOWS_
#include <malloc.h>
#else
#include <unistd.h>
#endif
#include "julia.h"
#include "julia_internal.h"
#ifndef _OS_WINDOWS_
#include <unistd.h>
#endif

// ::ANY has no effect if the number of overlapping methods is greater than this
#define MAX_UNSPECIALIZED_CONFLICTS 10
Expand Down
2 changes: 1 addition & 1 deletion src/jl_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ struct work_baton {
void *work_args;
void *work_retval;
notify_cb_t notify_func;
pid_t tid;
int tid;
int notify_idx;
};

Expand Down
5 changes: 3 additions & 2 deletions src/support/strptime.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ __RCSID("$NetBSD: strptime.c,v 1.58 2015/10/31 03:42:00 ginsbach Exp $");
#include <time.h>
#include <stdint.h>
#include "tzfile.h"
#include "dtypes.h" // for strncasecmp on msvc

typedef unsigned int uint;
typedef unsigned char u_char;
Expand Down Expand Up @@ -621,15 +622,15 @@ again: switch (c = *fmt++) {
* Our current timezone
*/
ep = find_string(bp, &i,
(const char * const *)tzname,
(const char * const *)_tzname,
NULL, 2);
if (ep != NULL) {
tm->tm_isdst = i;
#ifdef TM_GMTOFF
tm->TM_GMTOFF = -timezone;
#endif
#ifdef TM_ZONE
tm->TM_ZONE = tzname[i];
tm->TM_ZONE = _tzname[i];
#endif
bp = ep;
continue;
Expand Down

0 comments on commit 9696e2b

Please sign in to comment.