![gal@spitfire.co.il](/assets/img/avatar_default.png)
![GitHub](/assets/img/avatar_default.png)
5 changed files with 2184 additions and 25 deletions
@ -0,0 +1,81 @@ |
|||||||
|
## v1.4.0 (2019-02-18) |
||||||
|
|
||||||
|
#### New Feature 🎉 |
||||||
|
|
||||||
|
- [#45](https://github.com/Schniz/fnm/pull/45) Use exit code 1 on errors on `fnm use` ([@Schniz](https://github.com/Schniz)) |
||||||
|
- [#42](https://github.com/Schniz/fnm/pull/42) Add support for .node-version files ([@Dean177](https://github.com/Dean177)) |
||||||
|
|
||||||
|
#### Documentation 📝 |
||||||
|
|
||||||
|
- [#44](https://github.com/Schniz/fnm/pull/44) Quick fix for the dev enviornment setup ([@AdamGS](https://github.com/AdamGS)) |
||||||
|
|
||||||
|
#### Committers: 3 |
||||||
|
|
||||||
|
- Adam Gutglick ([@AdamGS](https://github.com/AdamGS)) |
||||||
|
- Dean Merchant ([@Dean177](https://github.com/Dean177)) |
||||||
|
- Gal Schlezinger ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
## v1.3.0 (2019-02-14) |
||||||
|
|
||||||
|
#### New Feature 🎉 |
||||||
|
|
||||||
|
- [#36](https://github.com/Schniz/fnm/pull/36) Support Node.js mirrors ([@Schniz](https://github.com/Schniz)) |
||||||
|
- [#30](https://github.com/Schniz/fnm/pull/30) Aliases and multishell support ([@Schniz](https://github.com/Schniz)) |
||||||
|
- [#37](https://github.com/Schniz/fnm/pull/37) Don't throw on existing installation ([@Schniz](https://github.com/Schniz)) |
||||||
|
- [#27](https://github.com/Schniz/fnm/pull/27) skip installation if the version is already installed ([@kentac55](https://github.com/kentac55)) |
||||||
|
|
||||||
|
#### Documentation 📝 |
||||||
|
|
||||||
|
- [#22](https://github.com/Schniz/fnm/pull/22) Add a LICENSE file ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
#### Committers: 2 |
||||||
|
|
||||||
|
- Gal Schlezinger ([@Schniz](https://github.com/Schniz)) |
||||||
|
- [@kentac55](https://github.com/kentac55) |
||||||
|
|
||||||
|
## v1.2.1 (2019-02-11) |
||||||
|
|
||||||
|
#### Bugfix 🐛 |
||||||
|
|
||||||
|
- [#25](https://github.com/Schniz/fnm/pull/25) CI (fnm-linux => fnm) ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
#### Internal 🛠 |
||||||
|
|
||||||
|
- [#21](https://github.com/Schniz/fnm/pull/21) Add feature test for Fish shell ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
#### Documentation 📝 |
||||||
|
|
||||||
|
- [#23](https://github.com/Schniz/fnm/pull/23) Add installation script ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
#### Committers: 1 |
||||||
|
|
||||||
|
- Gal Schlezinger ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
## v1.2.0 (2019-01-30) |
||||||
|
|
||||||
|
#### New Feature 🎉 |
||||||
|
|
||||||
|
- [#17](https://github.com/Schniz/fnm/pull/17) Use xz files instead of gz ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
#### Bugfix 🐛 |
||||||
|
|
||||||
|
- [#16](https://github.com/Schniz/fnm/pull/16) Make `fnm --version` show the correct version ([@Schniz](https://github.com/Schniz)) |
||||||
|
- [#15](https://github.com/Schniz/fnm/pull/15) Don't throw in nonexistent directory on `fnm ls` ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
#### Documentation 📝 |
||||||
|
|
||||||
|
- [#13](https://github.com/Schniz/fnm/pull/13) Added short docs to the README ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
#### Committers: 1 |
||||||
|
|
||||||
|
- Gal Schlezinger ([@Schniz](https://github.com/Schniz)) |
||||||
|
|
||||||
|
## v1.1.0 (2019-01-27) |
||||||
|
|
||||||
|
#### New Feature 🎉 |
||||||
|
|
||||||
|
- [#10](https://github.com/Schniz/fnm/pull/10) Add fish shell setup to `env` command and README ([@elliottsj](https://github.com/elliottsj)) |
||||||
|
|
||||||
|
#### Committers: 1 |
||||||
|
|
||||||
|
- Spencer Elliott ([@elliottsj](https://github.com/elliottsj)) |
@ -0,0 +1,201 @@ |
|||||||
|
--- ./config/detect.sh
|
||||||
|
+++ ./config/detect.sh
|
||||||
|
@@ -4,14 +4,27 @@
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
-if ld -lm -shared --wrap caml_modify -o /dev/null 2>/dev/null; then
|
||||||
|
+
|
||||||
|
+system="$( ocamlfind ocamlc -config | awk '/^system:/ {print $2}')"
|
||||||
|
+case "$system" in
|
||||||
|
+ win*)
|
||||||
|
+ ld_wrap_possible=false
|
||||||
|
+ posix_timers_possible=false
|
||||||
|
+ ;;
|
||||||
|
+ mingw*)
|
||||||
|
+ ld_wrap_possible=false
|
||||||
|
+ posix_timers_possible=false
|
||||||
|
+ ;;
|
||||||
|
+ *)
|
||||||
|
+
|
||||||
|
+ if ld -lm -shared --wrap caml_modify -o /dev/null 2>/dev/null; then
|
||||||
|
ld_wrap_possible=true
|
||||||
|
-else
|
||||||
|
+ else
|
||||||
|
ld_wrap_possible=false
|
||||||
|
-fi
|
||||||
|
+ fi
|
||||||
|
|
||||||
|
-ptimer=`getconf _POSIX_TIMERS || echo undefined`
|
||||||
|
-case $ptimer in
|
||||||
|
+ ptimer=`getconf _POSIX_TIMERS || echo undefined`
|
||||||
|
+ case $ptimer in
|
||||||
|
undefined)
|
||||||
|
posix_timers_possible=false
|
||||||
|
;;
|
||||||
|
@@ -22,6 +35,8 @@
|
||||||
|
posix_timers_possible=false
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
+ esac
|
||||||
|
+ ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -e setup.data ]; then
|
||||||
|
--- ./src/bigstring_marshal_stubs.c
|
||||||
|
+++ ./src/bigstring_marshal_stubs.c
|
||||||
|
@@ -1,5 +1,7 @@
|
||||||
|
#include <string.h>
|
||||||
|
+#ifndef _MSC_VER
|
||||||
|
#include <unistd.h>
|
||||||
|
+#endif
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <caml/alloc.h>
|
||||||
|
--- ./src/bigstring_stubs.c
|
||||||
|
+++ ./src/bigstring_stubs.c
|
||||||
|
@@ -11,16 +11,37 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
+#ifndef _MSC_VER
|
||||||
|
#include <unistd.h>
|
||||||
|
+#include <stdint.h>
|
||||||
|
+#else
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include <errno.h>
|
||||||
|
#include <assert.h>
|
||||||
|
-#include <stdint.h>
|
||||||
|
+
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <libkern/OSByteOrder.h>
|
||||||
|
#define bswap_16 OSSwapInt16
|
||||||
|
#define bswap_32 OSSwapInt32
|
||||||
|
#define bswap_64 OSSwapInt64
|
||||||
|
+#elif __MINGW32__
|
||||||
|
+#if defined(__GNUC__) && __GNUC__ > 4
|
||||||
|
+#define bswap_16 __builtin_bswap16
|
||||||
|
+#else
|
||||||
|
+static inline uint16_t bswap_16 (uint16_t x)
|
||||||
|
+{
|
||||||
|
+ return (x << 8) | (x >> 8);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
+#define bswap_32 __builtin_bswap32
|
||||||
|
+#define bswap_64 __builtin_bswap64
|
||||||
|
+#elif _MSC_VER
|
||||||
|
+#define bswap_16 _byteswap_ushort
|
||||||
|
+#define bswap_32 _byteswap_ulong
|
||||||
|
+#define bswap_64 _byteswap_uint64
|
||||||
|
#elif __GLIBC__
|
||||||
|
#include <byteswap.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
--- ./src/time_ns_stubs.c
|
||||||
|
+++ ./src/time_ns_stubs.c
|
||||||
|
@@ -12,7 +12,9 @@
|
||||||
|
#include <caml/unixsupport.h>
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
+#ifndef _MSC_VER
|
||||||
|
#include <stdint.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#include "ocaml_utils.h"
|
||||||
|
#include "config.h"
|
||||||
|
@@ -22,7 +24,59 @@
|
||||||
|
#define NANOS_PER_SECOND 1000000000
|
||||||
|
|
||||||
|
#if defined(JSC_POSIX_TIMERS)
|
||||||
|
+#ifdef _WIN32
|
||||||
|
+#include <windows.h>
|
||||||
|
|
||||||
|
+#ifndef CLOCK_REALTIME
|
||||||
|
+#define CLOCK_REALTIME 1
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#define POW10_7 10000000
|
||||||
|
+#define DELTA_EPOCH_IN_100NS INT64_C(116444736000000000)
|
||||||
|
+
|
||||||
|
+typedef void (WINAPI *GetSystemTimeAsFileTime_t)(LPFILETIME lpSystemTimeAsFileTime);
|
||||||
|
+static GetSystemTimeAsFileTime_t i_GetSystemTimeAsFileTime = GetSystemTimeAsFileTime;
|
||||||
|
+static int clock_gettime_init_called = 0;
|
||||||
|
+
|
||||||
|
+static void clock_gettime_init(void) {
|
||||||
|
+ /* Use GetSystemTimePreciseAsFileTime when available */
|
||||||
|
+ HMODULE h ;
|
||||||
|
+ clock_gettime_init_called = 1;
|
||||||
|
+ h = LoadLibrary("kernel32.dll");
|
||||||
|
+ if (h != NULL) {
|
||||||
|
+ GetSystemTimeAsFileTime_t proc = (GetSystemTimeAsFileTime_t)GetProcAddress(h, "GetSystemTimePreciseAsFileTime");
|
||||||
|
+ if (proc != NULL) {
|
||||||
|
+ i_GetSystemTimeAsFileTime = proc;
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ FreeLibrary(h);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#define clock_gettime my_clock_gettime
|
||||||
|
+static int my_clock_gettime(int clock_id, struct timespec *tp)
|
||||||
|
+{
|
||||||
|
+ uint64_t t;
|
||||||
|
+ FILETIME ft;
|
||||||
|
+ ULARGE_INTEGER lft;
|
||||||
|
+ (void) clock_id;
|
||||||
|
+ if ( clock_gettime_init_called == 0 ){
|
||||||
|
+ clock_gettime_init();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ i_GetSystemTimeAsFileTime(&ft);
|
||||||
|
+
|
||||||
|
+ lft.LowPart = ft.dwLowDateTime;
|
||||||
|
+ lft.HighPart = ft.dwHighDateTime;
|
||||||
|
+
|
||||||
|
+ t = lft.QuadPart - DELTA_EPOCH_IN_100NS;
|
||||||
|
+ tp->tv_sec = t / POW10_7;
|
||||||
|
+ tp->tv_nsec = ((int) (t % POW10_7)) * 100;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+#endif /* _WIN32 */
|
||||||
|
/* Note: this is imported noalloc if (and only if) ARCH_SIXTYFOUR is defined.
|
||||||
|
* This is OK because caml_alloc_int63 doesn't actually allocate in that case. */
|
||||||
|
CAMLprim value core_kernel_time_ns_gettime_or_zero()
|
||||||
|
@@ -38,7 +92,33 @@
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
+#ifndef _MSC_VER
|
||||||
|
#include <sys/time.h>
|
||||||
|
+#endif
|
||||||
|
+#ifdef _MSC_VER
|
||||||
|
+#include <time.h>
|
||||||
|
+
|
||||||
|
+#define DELTA_EPOCH_IN_MICROSECS 116444736000000000Ui64
|
||||||
|
+
|
||||||
|
+static int gettimeofday(struct timeval *tp, void *tz)
|
||||||
|
+{
|
||||||
|
+ FILETIME file_time;
|
||||||
|
+ SYSTEMTIME system_time;
|
||||||
|
+ ULARGE_INTEGER ularge;
|
||||||
|
+ (void)tz;
|
||||||
|
+
|
||||||
|
+ GetSystemTime(&system_time);
|
||||||
|
+ SystemTimeToFileTime(&system_time, &file_time);
|
||||||
|
+ ularge.LowPart = file_time.dwLowDateTime;
|
||||||
|
+ ularge.HighPart = file_time.dwHighDateTime;
|
||||||
|
+
|
||||||
|
+ tp->tv_sec = (long) ((ularge.QuadPart - DELTA_EPOCH_IN_MICROSECS) / 10000000L);
|
||||||
|
+ tp->tv_usec = (long) (system_time.wMilliseconds * 1000);
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
CAMLprim value core_kernel_time_ns_gettime_or_zero()
|
||||||
|
{
|
@ -0,0 +1,17 @@ |
|||||||
|
{ |
||||||
|
"build": [ |
||||||
|
[ |
||||||
|
"bash", |
||||||
|
"-c", |
||||||
|
"#{os == 'windows' ? 'patch -p1 < core_kernel-0.11.1.patch' : 'true'}" |
||||||
|
], |
||||||
|
[ |
||||||
|
"jbuilder", |
||||||
|
"build", |
||||||
|
"-p", |
||||||
|
"core_kernel", |
||||||
|
"-j", |
||||||
|
"4" |
||||||
|
] |
||||||
|
] |
||||||
|
} |
Loading…
Reference in new issue