summaryrefslogtreecommitdiffstats
path: root/xpcom/string
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 /xpcom/string
parentff881bdb6795e0f307b93919f98f454bedde4bb6 (diff)
parenta9dc528a4a7b0aaad5308aff70963485ec3e9bec (diff)
downloadUXP-21b3f6247403c06f85e1f45d219f87549862198f.tar
UXP-21b3f6247403c06f85e1f45d219f87549862198f.tar.gz
UXP-21b3f6247403c06f85e1f45d219f87549862198f.tar.lz
UXP-21b3f6247403c06f85e1f45d219f87549862198f.tar.xz
UXP-21b3f6247403c06f85e1f45d219f87549862198f.zip
Merge pull request #1262 from athenian200/solaris-work
Support Modern Solaris
Diffstat (limited to 'xpcom/string')
-rw-r--r--xpcom/string/nsTSubstring.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/xpcom/string/nsTSubstring.h b/xpcom/string/nsTSubstring.h
index 53b4fb9a8..537889d5c 100644
--- a/xpcom/string/nsTSubstring.h
+++ b/xpcom/string/nsTSubstring.h
@@ -10,6 +10,14 @@
#include "mozilla/IntegerTypeTraits.h"
#include "mozilla/Span.h"
+// Solaris defines pid_t to be long on ILP32 and int on LP64. I checked in
+// sys/types.h. AMD64 and SPARC64 builds don't need this fix at all,
+// while all 32-bit builds do.
+
+#if defined(XP_SOLARIS) && !defined(__LP64__)
+#include <unistd.h>
+#endif
+
#ifndef MOZILLA_INTERNAL_API
#error Cannot use internal string classes without MOZILLA_INTERNAL_API defined. Use the frozen header nsStringAPI.h instead.
#endif
@@ -587,6 +595,17 @@ public:
const char* fmt = aRadix == 10 ? "%d" : aRadix == 8 ? "%o" : "%x";
AppendPrintf(fmt, aInteger);
}
+#if defined(XP_SOLARIS) && !defined(__LP64__)
+ void AppendInt(pid_t aInteger)
+ {
+ AppendPrintf("%lu", aInteger);
+ }
+ void AppendInt(pid_t aInteger, int aRadix)
+ {
+ const char* fmt = aRadix == 10 ? "%lu" : aRadix == 8 ? "%lo" : "%lx";
+ AppendPrintf(fmt, aInteger);
+ }
+#endif
void AppendInt(uint32_t aInteger)
{
AppendPrintf("%u", aInteger);