diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-12-22 01:23:56 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-12-22 01:26:49 +0100 |
commit | 54091ecab46c93c2e1b2c689e9179a980beaabe6 (patch) | |
tree | 5cead66d889007e1b06c5dbb8e3d37b2538d0557 /xpcom/string | |
parent | c1013e9122456b342d65e4eb4c38a7281d8d83d2 (diff) | |
parent | 492624a7106ecbc18994b465ca1dd23fa472bf7e (diff) | |
download | UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar.gz UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar.lz UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar.xz UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.zip |
Forward to new tree structure.
Diffstat (limited to 'xpcom/string')
-rw-r--r-- | xpcom/string/nsTSubstring.h | 19 |
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); |