home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC.ZIP / PUREERR.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.0 KB  |  48 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - pureerr.cpp
  3.  * Error routine linked in when pure function called
  4.  *-----------------------------------------------------------------------*/
  5.  
  6. /*
  7.  *      C/C++ Run Time Library - Version 5.0
  8.  *
  9.  *      Copyright (c) 1990, 1992 by Borland International
  10.  *      All Rights Reserved.
  11.  *
  12.  */
  13.  
  14.  
  15. /*
  16.    A pointer to this routine is linked into virtual vectors whenever
  17.    a virtual function has been declared pure.
  18. */
  19.  
  20. #include <stdlib.h>
  21. #include <_io.h>
  22.  
  23. #ifdef _Windows
  24. #define _LOADDS
  25. extern "C" unsigned far _GetDGROUP(void);
  26. #else
  27. #define _LOADDS _loadds
  28. #endif
  29.  
  30.  
  31. extern "C" void near _LOADDS _npure_error_()
  32. {
  33. #ifdef _Windows
  34.         _DS = _GetDGROUP();
  35. #endif
  36.         __ErrorMessage("Pure virtual function called");
  37.         exit(EXIT_FAILURE);
  38. }
  39.  
  40. extern "C" void far _LOADDS _fpure_error_()
  41. {
  42. #ifdef _Windows
  43.         _DS = _GetDGROUP();
  44. #endif
  45.         __ErrorMessage("Pure virtual function called");
  46.         exit(EXIT_FAILURE);
  47. }
  48.