Unified · Split
| @@ -63,6 +63,37 @@ · 62 unmodified lines | ||
| 63 | 63 | |
| 64 | 64 | #include <math.h> |
| 65 | 65 | |
| 66 | +#elif (defined (__WATCOMC__) && defined(__386__)) | |
| 67 | + | |
| 68 | + #include <math.h> | |
| 69 | + | |
| 70 | + #undef HAVE_LRINT_REPLACEMENT | |
| 71 | + #define HAVE_LRINT_REPLACEMENT 1 | |
| 72 | + | |
| 73 | + #undef lrint | |
| 74 | + #undef lrintf | |
| 75 | + | |
| 76 | + #define lrint double2int | |
| 77 | + #define lrintf float2int | |
| 78 | + | |
| 79 | +extern __inline long double2int(double); | |
| 80 | +#pragma aux double2int = \ | |
| 81 | + "push eax" \ | |
| 82 | + "fistp dword ptr [esp]" \ | |
| 83 | + "pop eax" \ | |
| 84 | + parm [8087] \ | |
| 85 | + value [eax] \ | |
| 86 | + modify exact [eax]; | |
| 87 | + | |
| 88 | +extern __inline long float2int(float); | |
| 89 | +#pragma aux float2int = \ | |
| 90 | + "push eax" \ | |
| 91 | + "fistp dword ptr [esp]" \ | |
| 92 | + "pop eax" \ | |
| 93 | + parm [8087] \ | |
| 94 | + value [eax] \ | |
| 95 | + modify exact [eax]; | |
| 96 | + | |
| 66 | 97 | #elif (defined (__CYGWIN__)) |
| 67 | 98 | |
| 68 | 99 | #include <math.h> |