Skip to content

Commit

Permalink
Fixed bug 3768 - provide a quick copysign() solution for watcom
Browse files Browse the repository at this point in the history
Ozkan Sezer

The following patch provides a quick copysign solution for Watcom/x86
  • Loading branch information
slouken committed Aug 21, 2017
1 parent 9b3ec6a commit fcf83e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stdlib/SDL_stdlib.c
Expand Up @@ -109,6 +109,12 @@ SDL_copysign(double x, double y)
return copysign(x, y);
#elif defined(HAVE__COPYSIGN)
return _copysign(x, y);
#elif defined(__WATCOMC__) && defined(__386__)
/* this is nasty as hell, but it works.. */
unsigned int *xi = (unsigned int *) &x,
*yi = (unsigned int *) &y;
xi[1] = (yi[1] & 0x80000000) | (xi[1] & 0x7fffffff);
return x;
#else
return SDL_uclibc_copysign(x, y);
#endif /* HAVE_COPYSIGN */
Expand Down

0 comments on commit fcf83e7

Please sign in to comment.