Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8a0ee66
Showing
10 changed files
with
4,749 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --git a/Distribution/Simple/GHCJS.hs b/Distribution/Simple/GHCJS.hs | ||
index 4ad5bb18c..5db4d27e7 100644 | ||
--- a/Distribution/Simple/GHCJS.hs | ||
+++ b/Distribution/Simple/GHCJS.hs | ||
@@ -317,13 +317,10 @@ checkPackageDbStack :: Verbosity -> PackageDBStack -> IO () | ||
checkPackageDbStack _ (GlobalPackageDB:rest) | ||
| GlobalPackageDB `notElem` rest = return () | ||
checkPackageDbStack verbosity rest | ||
- | GlobalPackageDB `notElem` rest = | ||
- die' verbosity $ "With current ghc versions the global package db is always used " | ||
- ++ "and must be listed first. This ghc limitation may be lifted in " | ||
- ++ "future, see http://ghc.haskell.org/trac/ghc/ticket/5977" | ||
-checkPackageDbStack verbosity _ = | ||
+ | GlobalPackageDB `elem` rest = | ||
die' verbosity $ "If the global package db is specified, it must be " | ||
++ "specified first and cannot be specified multiple times" | ||
+checkPackageDbStack _ _ = return () | ||
|
||
getInstalledPackages' :: Verbosity -> [PackageDB] -> ProgramDb | ||
-> IO [(PackageDB, [InstalledPackageInfo])] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff --git b/basement.cabal a/basement.cabal | ||
index 72125e015..b7670c3ee 100644 | ||
--- b/basement.cabal | ||
+++ a/basement.cabal | ||
@@ -160,3 +160,5 @@ library | ||
c-sources: cbits/foundation_mem.c | ||
if impl(ghc < 8.2) | ||
c-sources: cbits/basement_rts.c | ||
+ if os(ghcjs) | ||
+ js-sources: jsbits/basement.js | ||
diff --git b/jsbits/basement.js a/jsbits/basement.js | ||
new file mode 100644 | ||
index 000000000..3d9172147 | ||
--- /dev/null | ||
+++ a/jsbits/basement.js | ||
@@ -0,0 +1,3 @@ | ||
+function h$_foundation_memcmp(s1, o1, off1, s2, o2, off2, n) { | ||
+ h$memcmp(s1, o1 + off2, s2, o2 + off2, n); | ||
+} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
diff --git b/clock.cabal a/clock.cabal | ||
index 253033538..8a73b9640 100644 | ||
--- b/clock.cabal | ||
+++ a/clock.cabal | ||
@@ -84,6 +84,8 @@ library | ||
if flag(llvm) | ||
ghc-options: -fllvm -optlo-O3 | ||
|
||
+ if os(ghcjs) | ||
+ js-sources: jsbits/gettime.js | ||
|
||
test-suite test | ||
default-language: Haskell2010 | ||
diff --git b/jsbits/gettime.js a/jsbits/gettime.js | ||
new file mode 100644 | ||
index 000000000..a09f351b9 | ||
--- /dev/null | ||
+++ a/jsbits/gettime.js | ||
@@ -0,0 +1,23 @@ | ||
+function h$clock_gettime(when, p_d, p_o) { | ||
+ /* XXX: guess if we have to write 64 bit values: | ||
+ alloca is often used and will give us 16 bytes | ||
+ if timespec contains two 64 bit values | ||
+ but we really should fix this by not having hsc2hs values | ||
+ from the build system leak here | ||
+ */ | ||
+ var is64 = p_d.i3.length == 4 && p_o == 0; | ||
+ var o = p_o >> 2, | ||
+ t = Date.now ? Date.now() : new Date().getTime(), | ||
+ tf = Math.floor(t / 1000), | ||
+ tn = 1000000 * (t - (1000 * tf)); | ||
+ if(is64) { | ||
+ p_d.i3[o] = tf|0; | ||
+ p_d.i3[o+1] = 0; | ||
+ p_d.i3[o+2] = tn|0; | ||
+ p_d.i3[o+3] = 0; | ||
+ } else { | ||
+ p_d.i3[o] = tf|0; | ||
+ p_d.i3[o+1] = tn|0; | ||
+ } | ||
+ return 0; | ||
+} |
Oops, something went wrong.