MoonchildProductions#1251 - Part 15: fdlibm should provide definition for u_int32_t and u_int64_t.

https://bugzilla.mozilla.org/show_bug.cgi?id=1350355

u_int32_t is not an stdint.h type. Windows already requires this, Solaris needs it too. If someone has a nit with this approach, the alternatives include:

1. Just replacing every instance of u_int32_t with uint32_t.

2. Including <sys/types.h> for Solaris only, which does define this.

3. Changing the original ifdef to be WIN32 || XP_SOLARIS

But it really doesn't matter how you solve this problem, all of the approaches are functionally equivalent, and this one has been used in Firefox since version 55. As far as I can tell, all it does is apply a fix that was being done for Windows already to any platform that needs it.
This commit is contained in:
athenian200 2019-10-02 17:38:39 -05:00 committed by Roy Tam
commit 63e0d2e326
2 changed files with 6 additions and 2 deletions

View file

@ -10,8 +10,10 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
* endianness at run time.
*/
+#ifdef WIN32
+#ifndef u_int32_t
+#define u_int32_t uint32_t
+#endif
+#ifndef u_int64_t
+#define u_int64_t uint64_t
+#endif
+

View file

@ -38,8 +38,10 @@
* endianness at run time.
*/
#ifdef WIN32
#ifndef u_int32_t
#define u_int32_t uint32_t
#endif
#ifndef u_int64_t
#define u_int64_t uint64_t
#endif