-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C99 Infinity problem #16
Comments
That is a UTL related issue. Probably I have missed something there when activating UTL support. @ewmailing could you add/activate a test-case for that? |
Hmmm. That's the JSC part... I have to make the JSC tests running first. |
On 9/4/13, Oliver Buchtala [email protected] wrote:
Sure. Though maybe you can tell me if I'm doing this correctly. I created an infinity.i file in Examples/test-suite: %module infinity Then in Examples/test-suite/javascript, I created infinity_runme.js: Is that correct? Also, what is the correct way to expose conditional #defines like I wanted to do something like this, but it doesn't work and nothing The header file that this case originated from looks like this to
#endif SWIG always hits the fallback case of 1e1000 and uses it directly Thanks, |
New information:
I think this is a general SWIG bug. Still would appreciate comments if my unit test was correct and how to Thanks, |
Sorry, I didn't get it fully. Is it so, that INFINITY gets defined only in C99 compatible Those things should probably go into |
Eric, could you push your new test into a branch in your repos? |
On 9/5/13, Oliver Buchtala [email protected] wrote:
I still haven't gotten through the rebasing stuff and I'm worried my So for the meantime, I made at new branch called js_unit_tests for my fork at It contains a new test called infinity.i which triggers both the |
Great, thanks. |
Prefer $MAKE if specified in environment
Taken from https://github.com/oliver----/swig-v8/issues/12#issuecomment-23750151:
I just hit a new problem with the use of C99 INFINITY. I
have APIs that expect a float, so when the SWIG API is called to
convert double to float, an overflow check is run and my code throws
an error.
SWIGINTERN int
SWIG_AsVal_float SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, float *val)
{
double v;
int res = SWIG_AsVal_double SWIG_JSC_AS_CALL_ARGS(obj, &v);
if (SWIG_IsOK(res)) {
if ((v < -FLT_MAX || v > FLT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (float)(v);
}
}
return res;
}
If I remove the overflow check, my code seems to work.
The text was updated successfully, but these errors were encountered: