Bug 1421159 - Unbreak JS shell build on BSDs after bug bug 1410528. r=sfink
authorJan Beich <jbeich@FreeBSD.org>
Tue, 09 Jan 2018 03:20:37 +0000
changeset 454249 2530d8fe4490ba4ff129d991c1afae655dd90cad
parent 454248 be1ce4548b2e1fcb34e91fc7b514394de5eb9ddf
child 454250 0739354fe0d3338a36df2f5ec6d64a8850e711e7
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1421159, 1410528
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1421159 - Unbreak JS shell build on BSDs after bug bug 1410528. r=sfink
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -14,17 +14,17 @@
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/mozalloc.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/ScopeExit.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/TimeStamp.h"
 
 #include <chrono>
-#if defined(__linux__) || defined(XP_MACOSX)
+#ifdef JS_POSIX_NSPR
 # include <dlfcn.h>
 #endif
 #ifdef XP_WIN
 # include <direct.h>
 # include <process.h>
 #endif
 #include <errno.h>
 #include <fcntl.h>
@@ -60,17 +60,17 @@
 #include "jsprf.h"
 #include "jsscript.h"
 #include "jstypes.h"
 #include "jsutil.h"
 #ifdef XP_WIN
 # include "jswin.h"
 #endif
 #include "jswrapper.h"
-#if !defined(__linux__) && !defined(XP_MACOSX)
+#ifndef JS_POSIX_NSPR
 # include "prerror.h"
 # include "prlink.h"
 #endif
 #include "shellmoduleloader.out.h"
 
 #include "builtin/ModuleObject.h"
 #include "builtin/RegExp.h"
 #include "builtin/TestingFunctions.h"
@@ -137,17 +137,17 @@ using mozilla::Maybe;
 using mozilla::Nothing;
 using mozilla::NumberEqualsInt32;
 using mozilla::PodCopy;
 using mozilla::PodEqual;
 using mozilla::TimeDuration;
 using mozilla::TimeStamp;
 
 // Avoid an unnecessary NSPR dependency on Linux and OS X just for the shell.
-#if defined(__linux__) || defined(XP_MACOSX)
+#ifdef JS_POSIX_NSPR
 typedef void PRLibrary;
 
 static PRLibrary*
 PR_LoadLibrary(const char* path)
 {
     return dlopen(path, RTLD_LAZY | RTLD_GLOBAL);
 }
 
@@ -8781,17 +8781,17 @@ class AutoLibraryLoader {
         for (auto dll : libraries) {
             PR_UnloadLibrary(dll);
         }
     }
 
     PRLibrary* load(const char* path) {
         PRLibrary* dll = PR_LoadLibrary(path);
         if (!dll) {
-#if defined(__linux__) || defined(XP_MACOSX)
+#ifdef JS_POSIX_NSPR
             fprintf(stderr, "LoadLibrary '%s' failed: %s\n", path, dlerror());
 #else
             fprintf(stderr, "LoadLibrary '%s' failed with code %d\n", path, PR_GetError());
 #endif
             MOZ_CRASH("Failed to load library");
         }
 
         MOZ_ALWAYS_TRUE(libraries.append(dll));