Advertisement
Guest User

Untitled

a guest
Jul 15th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.78 KB | None | 0 0
  1. commit 6109ea73f262a48b8cf2816e1d0515c377e51a77
  2. Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
  3. Date:   Tue Jun 28 02:17:12 2016 +0300
  4.  
  5.     build: better compliancy: mingw/cross/duktape
  6.    
  7.     - mingw defines __forceinline as extern - conflicts with static __forceinline,
  8.       so just no-op __forceinline on platforms where we don't explicitly want it.
  9.     - Some windows compilers (mingw) do have S_ISREG etc, so don't redefine those
  10.       blindly for Windows.
  11.     - mingw has a convention of lower-case file names, so it fails to link with
  12.       Userenv.lib when cross compiling on Linux. Use lower case instead.
  13.       On Windows it doesn't matter since it's case-insensitive anyway.
  14.     - uv_get_data: use correct pointer at duk_get_lstring, possibly coerce later.
  15.  
  16. diff --git a/lib/miniz.c b/lib/miniz.c
  17. index 08211bf..ad6930d 100644
  18. --- a/lib/miniz.c
  19. +++ b/lib/miniz.c
  20. @@ -885,6 +885,11 @@ typedef unsigned char mz_validate_uint64[sizeof(mz_uint64)==8 ? 1 : -1];
  21.    #else
  22.      #define __forceinline
  23.    #endif
  24. +#else
  25. +  #ifdef __forceinline
  26. +    #undef __forceinline
  27. +  #endif
  28. +  #define __forceinline
  29.  #endif
  30.  
  31.  #ifdef __cplusplus
  32. diff --git a/src/duv.h b/src/duv.h
  33. index cba9411..38ab25a 100644
  34. --- a/src/duv.h
  35. +++ b/src/duv.h
  36. @@ -19,14 +19,28 @@ typedef enum { false, true } bool;
  37.  # include <fcntl.h>
  38.  # include <sys/types.h>
  39.  # include <sys/stat.h>
  40. +#ifndef  S_ISREG
  41.  # define S_ISREG(x)  (((x) & _S_IFMT) == _S_IFREG)
  42. +#endif
  43. +#ifndef  S_ISDIR
  44.  # define S_ISDIR(x)  (((x) & _S_IFMT) == _S_IFDIR)
  45. +#endif
  46. +#ifndef  S_ISFIFO
  47.  # define S_ISFIFO(x) (((x) & _S_IFMT) == _S_IFIFO)
  48. +#endif
  49. +#ifndef  S_ISCHR
  50.  # define S_ISCHR(x)  (((x) & _S_IFMT) == _S_IFCHR)
  51. +#endif
  52. +#ifndef  S_ISBLK
  53.  # define S_ISBLK(x)  0
  54. +#endif
  55. +#ifndef  S_ISLINK
  56.  # define S_ISLNK(x)  0
  57. +#endif
  58. +#ifndef  S_ISSOCK
  59.  # define S_ISSOCK(x) 0
  60.  #endif
  61. +#endif
  62.  
  63.  #ifndef PATH_MAX
  64.  #define PATH_MAX (8096)
  65. diff --git a/src/utils.c b/src/utils.c
  66. index dc1473e..4db311a 100644
  67. --- a/src/utils.c
  68. +++ b/src/utils.c
  69. @@ -113,12 +113,14 @@ void duv_fulfill_req(duk_context *ctx, uv_req_t* req, int nargs) {
  70.  }
  71.  
  72.  void duv_get_data(duk_context *ctx, int index, uv_buf_t* buf) {
  73. +  duk_size_t len;
  74.    if (duk_is_string(ctx, index)) {
  75. -    buf->base = (char*) duk_get_lstring(ctx, index, &buf->len);
  76. +    buf->base = (char*) duk_get_lstring(ctx, index, &len);
  77.    }
  78.    else {
  79. -    buf->base = duk_get_buffer(ctx, index, &buf->len);
  80. +    buf->base = duk_get_buffer(ctx, index, &len);
  81.    }
  82. +  buf->len = len;
  83.  }
  84.  
  85.  const char* duv_protocol_to_string(int family) {
  86. diff --git a/uv.cmake b/uv.cmake
  87. index bb685c5..d186a07 100644
  88. --- a/uv.cmake
  89. +++ b/uv.cmake
  90. @@ -187,7 +187,7 @@ if(WIN32)
  91.      psapi.lib
  92.      iphlpapi.lib
  93.      advapi32.lib
  94. -    Userenv.lib
  95. +    userenv.lib
  96.    )
  97.  endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement