home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / crt0fp.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  2KB  |  49 lines

  1. /***
  2. *crt0fp.asm - floating point not loaded trap
  3. *
  4. *       Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       To trap certain cases where certain necessary floating-point
  8. *       software is not loaded.  Two specific cases are when no emulator
  9. *       is linked in but no coprocessor is present, and when floating
  10. *       point i/o conversions are done, but no floating-point variables
  11. *       or expressions are used in the program.
  12. *
  13. *******************************************************************************/
  14.  
  15. #include <cruntime.h>
  16. #include <internal.h>
  17. #include <rterr.h>
  18.  
  19. /***
  20. *_fptrap - trap for missing floating-point software
  21. *
  22. *Purpose:
  23. *       Catches these cases of incomplete f.p. software linked into a program.
  24. *
  25. *       (1) no coprocessor present, and no emulator linked in
  26. *
  27. *       (2) "%e", "%f", and "%g" i/o conversion formats specified, but
  28. *           not all conversion software has been linked in, because the
  29. *           program did not use any floating-point variables or expressions.
  30. *
  31. *Entry:
  32. *       None.
  33. *
  34. *Exit:
  35. *       Never returns.
  36. *
  37. *Exceptions:
  38. *       Transfers control to _amsg_exit which ...
  39. *       - Writes error message to standard error:  "floating point not loaded"
  40. *       - Terminates the program by calling _exit().
  41. *******************************************************************************/
  42.  
  43. void __cdecl _fptrap(
  44.         void
  45.         )
  46. {
  47.         _amsg_exit(_RT_FLOAT);
  48. }
  49.