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
# ./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': [
{
'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',
],
'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'
],
'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': [
#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
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
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);
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);
/* 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
}
#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>
# 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;
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;
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;
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;
}
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;
}
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;
}
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;
}
#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>
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)
}
String::Utf8Value path(args[0]->ToString());
- mode_t mode = static_cast<mode_t>(args[1]->Int32Value());
+ eio_mode_t mode = static_cast<eio_mode_t>(args[1]->Int32Value());
if (args[2]->IsFunction()) {
ASYNC_CALL(mkdir, args[2], *path, mode)
String::Utf8Value path(args[0]->ToString());
int flags = args[1]->Int32Value();
- mode_t mode = static_cast<mode_t>(args[2]->Int32Value());
+ eio_mode_t mode = static_cast<eio_mode_t>(args[2]->Int32Value());
if (args[3]->IsFunction()) {
ASYNC_CALL(open, args[3], *path, flags, mode)
return THROW_BAD_ARGS;
}
String::Utf8Value path(args[0]->ToString());
- mode_t mode = static_cast<mode_t>(args[1]->Int32Value());
+ eio_mode_t mode = static_cast<eio_mode_t>(args[1]->Int32Value());
if(args[2]->IsFunction()) {
ASYNC_CALL(chmod, args[2], *path, mode);
#include <http_parser.h>
-#include <strings.h> /* strcasecmp() */
#include <string.h> /* strdup() */
+#if !defined(_MSC_VER)
+#include <strings.h> /* strcasecmp() */
+#else
+#define strcasecmp _stricmp
+#endif
#include <stdlib.h> /* free() */
// This is a binding to http_parser (http://github.com/ry/http-parser)
'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'
+ ],
+ }]
+ ],
},
'variables': {
}],
[ 'OS=="win"', {
- # until we figure out a good way to get openssl into the build system
+ 'dependencies': [
+ '../deps/uv/deps/pthread-win32/build/all.gyp:pthread-win32',
+ ],
+ # openssl is not built using gyp, and needs to be
+ # built separately and placed outside the hierarchy.
+ # the dependencies aren't set up yet to put it in
+ # place, so I'm going to force it off indiscrimately
+ # for the time being. Because the above condition has
+ # already kicked in, it's not enough simply to turn
+ # 'node_use_openssl' off; I need to undo its effects
'node_use_openssl': 'false',
+ 'defines!': [ 'HAVE_OPENSSL=1' ],
+ 'defines': [ 'HAVE_OPENSSL=0' ],
+ 'libraries!': [ '-lssl', '-lcrypto' ],
+ 'sources!': [ '../src/node_crypto.cc' ],
+ 'sources': [
+ '../src/platform_win32.cc',
+ '../src/node_stdio_win32.cc',
+ '../deps/uv/src/eio/eio.c', # file operations depend on eio to link. uv contains eio in unix builds, but not win32. So we need to compile it here instead.
+ ],
'defines': [
'PTW32_STATIC_LIB', # we'll need to add pthread-win32 and build/depend on that.
- 'FD_SETSIZE=1024'
+ 'FD_SETSIZE=1024',
],
'libraries': [
'-lws2_32.lib',
'-lwinmm.lib',
],
- 'sources': [
- '../src/platform_win32.cc',
- '../src/node_stdio_win32.cc',
- '../deps/uv/src/eio/eio.c', # file operations depend on eio to link. uv contains eio in unix builds, but not win32. So we need to compile it here instead.
- ],
'msvs_settings': {
'VCCLCompilerTool': {
'WarningLevel': '3',