Skip to content

Commit

Permalink
Add symbol __fpclassifyd as an alias to __fpclassify to satisfy test_…
Browse files Browse the repository at this point in the history
…python.
  • Loading branch information
juj committed Dec 16, 2014
1 parent 3974e99 commit b7f8cd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4531,8 +4531,6 @@ LibraryManager.library = {
return divt;
},

__fpclassifyd: '__fpclassify', // Needed by tests/python/python.le32.bc

// ==========================================================================
// sys/utsname.h
// ==========================================================================
Expand Down
10 changes: 10 additions & 0 deletions system/lib/libc/musl/src/math/__fpclassify.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include <math.h>
#include <stdint.h>

#ifdef __EMSCRIPTEN__
// XXX Emscripten: for weak_alias.
#include "libc.h"
#endif

int __fpclassify(double x)
{
union {double f; uint64_t i;} u = {x};
Expand All @@ -9,3 +14,8 @@ int __fpclassify(double x)
if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE;
return FP_NORMAL;
}

#ifdef __EMSCRIPTEN__
// XXX Emscripten: Needed by tests/python/python.le32.bc
weak_alias(__fpclassify, __fpclassifyd);
#endif

0 comments on commit b7f8cd2

Please sign in to comment.