Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Make MSVS build.
Browse files Browse the repository at this point in the history
MSVS settings don't actually need to be guarded by conditions. gyp will do
the right thing.
  • Loading branch information
DrPizza authored and ry committed Aug 7, 2011
1 parent b88c481 commit 6ac8c55
Show file tree
Hide file tree
Showing 11 changed files with 221 additions and 51 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Expand Up @@ -19,3 +19,18 @@ tools/all.target.mk
tools/node_js2c.host.mk
tools/node_js2c.target.mk
out/

# various stuff that VC++ produces/uses
Debug/
Release/
*.sln
*.suo
*.vcproj
*.vcxproj
*.vcxproj.user
*.vcxproj.filters
UpgradeLog*.XML
_UpgradeReport_Files/
ipch/
*.sdf
*.opensdf
35 changes: 32 additions & 3 deletions deps/http_parser/http_parser.gyp
Expand Up @@ -6,14 +6,43 @@
# ./out/Debug/test
{
'target_defaults': {
'default_configuration': 'Debug',
'configurations': {
# TODO: hoist these out and put them somewhere common, because
# RuntimeLibrary MUST MATCH across the entire project
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ]
'defines': [ 'DEBUG', '_DEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
},
},
},
'Release': {
'defines': [ 'NDEBUG' ]
'defines': [ 'NDEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
},
},
}
}
},
'msvs_settings': {
'VCCLCompilerTool': {
},
'VCLibrarianTool': {
},
'VCLinkerTool': {
'GenerateDebugInformation': 'true',
},
},
'conditions': [
['OS == "win"', {
'defines': [
'WIN32'
],
}]
],
},

'targets': [
Expand Down
42 changes: 33 additions & 9 deletions deps/uv/build/all.gyp
@@ -1,14 +1,44 @@
{
'target_defaults': {
'default_configuration': 'Debug',
'configurations': {
# TODO: hoist these out and put them somewhere common, because
# RuntimeLibrary MUST MATCH across the entire project
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ]
'defines': [ 'DEBUG', '_DEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
},
},
},
'Release': {
'defines': [ 'NDEBUG' ]
'defines': [ 'NDEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
},
},
}
}
},
'msvs_settings': {
'VCCLCompilerTool': {
},
'VCLibrarianTool': {
},
'VCLinkerTool': {
'GenerateDebugInformation': 'true',
},
},
'conditions': [
['OS == "win"', {
'defines': [
'WIN32'
],
}]
],
},

'targets': [
{
'target_name': 'uv',
Expand Down Expand Up @@ -69,12 +99,6 @@
],
'conditions': [
[ 'OS=="win"', {
'dependencies': [
'../deps/pthread-win32/build/all.gyp:pthread-win32'
],
'export_dependent_settings': [
'../deps/pthread-win32/build/all.gyp:pthread-win32'
],
'include_dirs': [
'../src/ares/config_win32'
],
Expand Down
24 changes: 20 additions & 4 deletions deps/uv/deps/pthread-win32/build/all.gyp
Expand Up @@ -9,18 +9,34 @@
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
}
}
},
},
},
'Release': {
'defines': [ 'NDEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
}
}
},
},
}
},
'msvs_settings': {
'VCCLCompilerTool': {
},
'VCLibrarianTool': {
},
'VCLinkerTool': {
'GenerateDebugInformation': 'true',
},
},
'conditions': [
['OS == "win"', {
'defines': [
'WIN32'
],
}]
],
},

'targets': [
Expand Down
14 changes: 9 additions & 5 deletions deps/uv/include/eio.h
Expand Up @@ -69,6 +69,7 @@ typedef int (*eio_cb)(eio_req *req);
#ifdef _WIN32
typedef int eio_uid_t;
typedef int eio_gid_t;
typedef int eio_mode_t;
#ifdef __MINGW32__ /* no intptr_t */
typedef ssize_t eio_ssize_t;
#else
Expand All @@ -84,6 +85,7 @@ typedef int (*eio_cb)(eio_req *req);
typedef gid_t eio_gid_t;
typedef ssize_t eio_ssize_t;
typedef ino_t eio_ino_t;
typedef mode_t eio_mode_t;
#endif

#ifndef EIO_STRUCT_STATVFS
Expand Down Expand Up @@ -307,16 +309,16 @@ eio_req *eio_fstat (int fd, int pri, eio_cb cb, void *data); /* stat buffer=
eio_req *eio_fstatvfs (int fd, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
eio_req *eio_futime (int fd, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data);
eio_req *eio_ftruncate (int fd, off_t offset, int pri, eio_cb cb, void *data);
eio_req *eio_fchmod (int fd, mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_fchmod (int fd, eio_mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_fchown (int fd, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data);
eio_req *eio_dup2 (int fd, int fd2, int pri, eio_cb cb, void *data);
eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, int pri, eio_cb cb, void *data);
eio_req *eio_open (const char *path, int flags, mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_open (const char *path, int flags, eio_mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_utime (const char *path, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data);
eio_req *eio_truncate (const char *path, off_t offset, int pri, eio_cb cb, void *data);
eio_req *eio_chown (const char *path, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data);
eio_req *eio_chmod (const char *path, mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_mkdir (const char *path, mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_chmod (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_mkdir (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_readdir (const char *path, int flags, int pri, eio_cb cb, void *data); /* result=ptr2 allocated dynamically */
eio_req *eio_rmdir (const char *path, int pri, eio_cb cb, void *data);
eio_req *eio_unlink (const char *path, int pri, eio_cb cb, void *data);
Expand All @@ -325,7 +327,7 @@ eio_req *eio_realpath (const char *path, int pri, eio_cb cb, void *data); /* re
eio_req *eio_stat (const char *path, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
eio_req *eio_lstat (const char *path, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
eio_req *eio_statvfs (const char *path, int pri, eio_cb cb, void *data); /* stat buffer=ptr2 allocated dynamically */
eio_req *eio_mknod (const char *path, mode_t mode, dev_t dev, int pri, eio_cb cb, void *data);
eio_req *eio_mknod (const char *path, eio_mode_t mode, dev_t dev, int pri, eio_cb cb, void *data);
eio_req *eio_link (const char *path, const char *new_path, int pri, eio_cb cb, void *data);
eio_req *eio_symlink (const char *path, const char *new_path, int pri, eio_cb cb, void *data);
eio_req *eio_rename (const char *path, const char *new_path, int pri, eio_cb cb, void *data);
Expand Down Expand Up @@ -363,6 +365,8 @@ void eio_cancel (eio_req *req);
/* convenience functions */

eio_ssize_t eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count);
eio_ssize_t eio__pread (int fd, void *buf, size_t count, off_t offset);
eio_ssize_t eio__pwrite (int fd, void *buf, size_t count, off_t offset);

#ifdef __cplusplus
}
Expand Down
75 changes: 63 additions & 12 deletions deps/uv/src/eio/eio.c
Expand Up @@ -200,6 +200,57 @@ static void eio_destroy (eio_req *req);
#define D_NAME(entp) entp.cFileName
#define D_TYPE(entp) (entp.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ? DT_DIR : DT_REG)

#include <sys/utime.h>
#define utime(path, times) _utime(path, times)
#define utimbuf _utimbuf

#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif

struct timezone
{
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};

static int gettimeofday(struct timeval *tv, struct timezone *tz)
{
FILETIME ft;
unsigned __int64 tmpres = 0;
static int tzflag;

if (NULL != tv)
{
GetSystemTimeAsFileTime(&ft);

tmpres |= ft.dwHighDateTime;
tmpres <<= 32;
tmpres |= ft.dwLowDateTime;

/*converting file time to unix epoch*/
tmpres -= DELTA_EPOCH_IN_MICROSECS;
tmpres /= 10; /*convert into microseconds*/
tv->tv_sec = (long)(tmpres / 1000000UL);
tv->tv_usec = (long)(tmpres % 1000000UL);
}

if (NULL != tz)
{
if (!tzflag)
{
_tzset();
tzflag++;
}
tz->tz_minuteswest = _timezone / 60;
tz->tz_dsttime = _daylight;
}

return 0;
}

#else

#include <sys/time.h>
Expand Down Expand Up @@ -912,7 +963,7 @@ int eio_poll (void)
# define pread eio__pread
# define pwrite eio__pwrite

static eio_ssize_t
eio_ssize_t
eio__pread (int fd, void *buf, size_t count, off_t offset)
{
eio_ssize_t res;
Expand All @@ -928,7 +979,7 @@ eio__pread (int fd, void *buf, size_t count, off_t offset)
return res;
}

static eio_ssize_t
eio_ssize_t
eio__pwrite (int fd, void *buf, size_t count, off_t offset)
{
eio_ssize_t res;
Expand Down Expand Up @@ -2116,21 +2167,21 @@ eio_execute (etp_worker *self, eio_req *req)

case EIO_CHOWN: req->result = chown (req->ptr1, req->int2, req->int3); break;
case EIO_FCHOWN: req->result = fchown (req->int1, req->int2, req->int3); break;
case EIO_CHMOD: req->result = chmod (req->ptr1, (mode_t)req->int2); break;
case EIO_FCHMOD: req->result = fchmod (req->int1, (mode_t)req->int2); break;
case EIO_CHMOD: req->result = chmod (req->ptr1, (eio_mode_t)req->int2); break;
case EIO_FCHMOD: req->result = fchmod (req->int1, (eio_mode_t)req->int2); break;
case EIO_TRUNCATE: req->result = truncate (req->ptr1, req->offs); break;
case EIO_FTRUNCATE: req->result = ftruncate (req->int1, req->offs); break;

case EIO_OPEN: req->result = open (req->ptr1, req->int1, (mode_t)req->int2); break;
case EIO_OPEN: req->result = open (req->ptr1, req->int1, (eio_mode_t)req->int2); break;
case EIO_CLOSE: req->result = close (req->int1); break;
case EIO_DUP2: req->result = dup2 (req->int1, req->int2); break;
case EIO_UNLINK: req->result = unlink (req->ptr1); break;
case EIO_RMDIR: req->result = rmdir (req->ptr1); break;
case EIO_MKDIR: req->result = mkdir (req->ptr1, (mode_t)req->int2); break;
case EIO_MKDIR: req->result = mkdir (req->ptr1, (eio_mode_t)req->int2); break;
case EIO_RENAME: req->result = rename (req->ptr1, req->ptr2); break;
case EIO_LINK: req->result = link (req->ptr1, req->ptr2); break;
case EIO_SYMLINK: req->result = symlink (req->ptr1, req->ptr2); break;
case EIO_MKNOD: req->result = mknod (req->ptr1, (mode_t)req->int2, (dev_t)req->offs); break;
case EIO_MKNOD: req->result = mknod (req->ptr1, (eio_mode_t)req->int2, (dev_t)req->offs); break;

case EIO_REALPATH: eio__realpath (req, self); break;

Expand Down Expand Up @@ -2311,7 +2362,7 @@ eio_req *eio_ftruncate (int fd, off_t offset, int pri, eio_cb cb, void *data)
REQ (EIO_FTRUNCATE); req->int1 = fd; req->offs = offset; SEND;
}

eio_req *eio_fchmod (int fd, mode_t mode, int pri, eio_cb cb, void *data)
eio_req *eio_fchmod (int fd, eio_mode_t mode, int pri, eio_cb cb, void *data)
{
REQ (EIO_FCHMOD); req->int1 = fd; req->int2 = (long)mode; SEND;
}
Expand All @@ -2331,7 +2382,7 @@ eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, in
REQ (EIO_SENDFILE); req->int1 = out_fd; req->int2 = in_fd; req->offs = in_offset; req->size = length; SEND;
}

eio_req *eio_open (const char *path, int flags, mode_t mode, int pri, eio_cb cb, void *data)
eio_req *eio_open (const char *path, int flags, eio_mode_t mode, int pri, eio_cb cb, void *data)
{
REQ (EIO_OPEN); PATH; req->int1 = flags; req->int2 = (long)mode; SEND;
}
Expand All @@ -2351,12 +2402,12 @@ eio_req *eio_chown (const char *path, eio_uid_t uid, eio_gid_t gid, int pri, eio
REQ (EIO_CHOWN); PATH; req->int2 = (long)uid; req->int3 = (long)gid; SEND;
}

eio_req *eio_chmod (const char *path, mode_t mode, int pri, eio_cb cb, void *data)
eio_req *eio_chmod (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data)
{
REQ (EIO_CHMOD); PATH; req->int2 = (long)mode; SEND;
}

eio_req *eio_mkdir (const char *path, mode_t mode, int pri, eio_cb cb, void *data)
eio_req *eio_mkdir (const char *path, eio_mode_t mode, int pri, eio_cb cb, void *data)
{
REQ (EIO_MKDIR); PATH; req->int2 = (long)mode; SEND;
}
Expand Down Expand Up @@ -2407,7 +2458,7 @@ eio_req *eio_readdir (const char *path, int flags, int pri, eio_cb cb, void *dat
REQ (EIO_READDIR); PATH; req->int1 = flags; SEND;
}

eio_req *eio_mknod (const char *path, mode_t mode, dev_t dev, int pri, eio_cb cb, void *data)
eio_req *eio_mknod (const char *path, eio_mode_t mode, dev_t dev, int pri, eio_cb cb, void *data)
{
REQ (EIO_MKNOD); PATH; req->int2 = (long)mode; req->offs = (off_t)dev; SEND;
}
Expand Down
2 changes: 0 additions & 2 deletions deps/uv/src/eio/xthread.h
Expand Up @@ -17,8 +17,6 @@

#ifdef _WIN32

#define NTDDI_VERSION NTDDI_WIN2K // needed to get win2000 api calls
#define _WIN32_WINNT 0x400
#include <stdio.h>//D
#include <fcntl.h>
#include <io.h>
Expand Down
2 changes: 1 addition & 1 deletion src/node_extensions.h
Expand Up @@ -26,7 +26,7 @@ NODE_EXT_LIST_ITEM(node_buffer)
NODE_EXT_LIST_ITEM(node_cares)
NODE_EXT_LIST_ITEM(node_child_process)
#endif
#ifdef HAVE_OPENSSL
#if HAVE_OPENSSL
NODE_EXT_LIST_ITEM(node_crypto)
#endif
NODE_EXT_LIST_ITEM(node_evals)
Expand Down

0 comments on commit 6ac8c55

Please sign in to comment.