summaryrefslogtreecommitdiff
path: root/js/src/vm
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2019-11-02 14:37:22 +0100
committerGitHub <noreply@github.com>2019-11-02 14:37:22 +0100
commit21b3f6247403c06f85e1f45d219f87549862198f (patch)
tree0038ae92f1cc7aaff0b55d6e5ac59efcc28bdf8f /js/src/vm
parentff881bdb6795e0f307b93919f98f454bedde4bb6 (diff)
parenta9dc528a4a7b0aaad5308aff70963485ec3e9bec (diff)
downloaduxp-21b3f6247403c06f85e1f45d219f87549862198f.tar.gz
Merge pull request #1262 from athenian200/solaris-work
Support Modern Solaris
Diffstat (limited to 'js/src/vm')
-rw-r--r--js/src/vm/Time.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/src/vm/Time.cpp b/js/src/vm/Time.cpp
index 87531c1483..a9a5b7f0fc 100644
--- a/js/src/vm/Time.cpp
+++ b/js/src/vm/Time.cpp
@@ -11,6 +11,10 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/MathAlgorithms.h"
+#ifdef XP_SOLARIS
+#define _REENTRANT 1
+#endif
+
#include <string.h>
#include <time.h>
@@ -30,6 +34,10 @@
#ifdef XP_UNIX
+#ifdef _SVID_GETTOD /* Defined only on Solaris, see Solaris <sys/types.h> */
+extern int gettimeofday(struct timeval* tv);
+#endif
+
#include <sys/time.h>
#endif /* XP_UNIX */
@@ -42,7 +50,11 @@ PRMJ_Now()
{
struct timeval tv;
+#ifdef _SVID_GETTOD /* Defined only on Solaris, see Solaris <sys/types.h> */
+ gettimeofday(&tv);
+#else
gettimeofday(&tv, 0);
+#endif /* _SVID_GETTOD */
return int64_t(tv.tv_sec) * PRMJ_USEC_PER_SEC + int64_t(tv.tv_usec);
}