home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 2.ddi / CLIB2.ZIP / PUREERR.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.5 KB  |  38 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - pureerr.cpp
  3.  * Error routine linked in when pure function called
  4.  *-----------------------------------------------------------------------*/
  5.  
  6. /*[]------------------------------------------------------------[]*/
  7. /*|                                                              |*/
  8. /*|     Turbo C++ Run Time Library - Version 1.0                 |*/
  9. /*|                                                              |*/
  10. /*|                                                              |*/
  11. /*|     Copyright (c) 1990 by Borland International              |*/
  12. /*|     All Rights Reserved.                                     |*/
  13. /*|                                                              |*/
  14. /*[]------------------------------------------------------------[]*/
  15.  
  16. /*
  17.    A pointer to this routine is linked into virtual vectors whenever
  18.    a virtual function has been declared pure.  Ideally, the error
  19.    message should be printed without using printf or stream I/O,
  20.    since we would rather not pull in the code for those.  Such a
  21.    result is system-dependent and beyond the scope of this implementation.
  22. */
  23.  
  24. #include <stdlib.h>
  25. #include <stdio.h>
  26.  
  27. extern "C" void near _npure_error_()
  28. {
  29.     printf("Pure virtual function called\n");
  30.     exit(EXIT_FAILURE);
  31. }
  32.  
  33. extern "C" void far _fpure_error_()
  34. {
  35.     printf("Pure virtual function called\n");
  36.     exit(EXIT_FAILURE);
  37. }
  38.