Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 6109ea73f262a48b8cf2816e1d0515c377e51a77
- Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
- Date: Tue Jun 28 02:17:12 2016 +0300
- build: better compliancy: mingw/cross/duktape
- - mingw defines __forceinline as extern - conflicts with static __forceinline,
- so just no-op __forceinline on platforms where we don't explicitly want it.
- - Some windows compilers (mingw) do have S_ISREG etc, so don't redefine those
- blindly for Windows.
- - mingw has a convention of lower-case file names, so it fails to link with
- Userenv.lib when cross compiling on Linux. Use lower case instead.
- On Windows it doesn't matter since it's case-insensitive anyway.
- - uv_get_data: use correct pointer at duk_get_lstring, possibly coerce later.
- diff --git a/lib/miniz.c b/lib/miniz.c
- index 08211bf..ad6930d 100644
- --- a/lib/miniz.c
- +++ b/lib/miniz.c
- @@ -885,6 +885,11 @@ typedef unsigned char mz_validate_uint64[sizeof(mz_uint64)==8 ? 1 : -1];
- #else
- #define __forceinline
- #endif
- +#else
- + #ifdef __forceinline
- + #undef __forceinline
- + #endif
- + #define __forceinline
- #endif
- #ifdef __cplusplus
- diff --git a/src/duv.h b/src/duv.h
- index cba9411..38ab25a 100644
- --- a/src/duv.h
- +++ b/src/duv.h
- @@ -19,14 +19,28 @@ typedef enum { false, true } bool;
- # include <fcntl.h>
- # include <sys/types.h>
- # include <sys/stat.h>
- +#ifndef S_ISREG
- # define S_ISREG(x) (((x) & _S_IFMT) == _S_IFREG)
- +#endif
- +#ifndef S_ISDIR
- # define S_ISDIR(x) (((x) & _S_IFMT) == _S_IFDIR)
- +#endif
- +#ifndef S_ISFIFO
- # define S_ISFIFO(x) (((x) & _S_IFMT) == _S_IFIFO)
- +#endif
- +#ifndef S_ISCHR
- # define S_ISCHR(x) (((x) & _S_IFMT) == _S_IFCHR)
- +#endif
- +#ifndef S_ISBLK
- # define S_ISBLK(x) 0
- +#endif
- +#ifndef S_ISLINK
- # define S_ISLNK(x) 0
- +#endif
- +#ifndef S_ISSOCK
- # define S_ISSOCK(x) 0
- #endif
- +#endif
- #ifndef PATH_MAX
- #define PATH_MAX (8096)
- diff --git a/src/utils.c b/src/utils.c
- index dc1473e..4db311a 100644
- --- a/src/utils.c
- +++ b/src/utils.c
- @@ -113,12 +113,14 @@ void duv_fulfill_req(duk_context *ctx, uv_req_t* req, int nargs) {
- }
- void duv_get_data(duk_context *ctx, int index, uv_buf_t* buf) {
- + duk_size_t len;
- if (duk_is_string(ctx, index)) {
- - buf->base = (char*) duk_get_lstring(ctx, index, &buf->len);
- + buf->base = (char*) duk_get_lstring(ctx, index, &len);
- }
- else {
- - buf->base = duk_get_buffer(ctx, index, &buf->len);
- + buf->base = duk_get_buffer(ctx, index, &len);
- }
- + buf->len = len;
- }
- const char* duv_protocol_to_string(int family) {
- diff --git a/uv.cmake b/uv.cmake
- index bb685c5..d186a07 100644
- --- a/uv.cmake
- +++ b/uv.cmake
- @@ -187,7 +187,7 @@ if(WIN32)
- psapi.lib
- iphlpapi.lib
- advapi32.lib
- - Userenv.lib
- + userenv.lib
- )
- endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement