Skip to content

Commit

Permalink
Fix for the GHCJS_BROWSER compilation flag of GHC JavaScript backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
Swordlash authored and hasufell committed Jan 6, 2025
1 parent 554b701 commit b9b134d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions jsbits/time.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//#OPTIONS: CPP

function h$js_futimes(fd,atime,mtime) {
#ifdef GHCJS_BROWSER
throw "h$js_futimes unsupported";
#else
if (!h$isNode()) {
throw "h$js_futimes unsupported";
}
Expand All @@ -9,9 +14,13 @@ function h$js_futimes(fd,atime,mtime) {
return -1;
}
return 0;
#endif
}

function h$js_utimes(path,path_offset,atime,mtime) {
#ifdef GHCJS_BROWSER
throw "h$js_utimes unsupported";
#else
if (!h$isNode()) {
throw "h$js_utimes unsupported";
}
Expand All @@ -23,9 +32,13 @@ function h$js_utimes(path,path_offset,atime,mtime) {
return -1;
}
return 0;
#endif
}

function h$js_lutimes(path,path_offset,atime,mtime) {
#ifdef GHCJS_BROWSER
throw "h$js_lutimes unsupported";
#else
if (!h$isNode()) {
throw "h$js_lutimes unsupported";
}
Expand All @@ -37,5 +50,6 @@ function h$js_lutimes(path,path_offset,atime,mtime) {
return -1;
}
return 0;
#endif
}

0 comments on commit b9b134d

Please sign in to comment.