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

  1. /***
  2. *cinitexe.c - C Run-Time Startup Initialization
  3. *
  4. *       Copyright (c) 1992-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Do C++ initialization segment declarations for the EXE in CRT DLL
  8. *       model
  9. *
  10. *Notes:
  11. *       The C++ initializers will exist in the user EXE's data segment
  12. *       so the special segments to contain them must be in the user EXE.
  13. *
  14. *******************************************************************************/
  15.  
  16. #ifndef _MAC
  17.  
  18. #include <stdio.h>
  19. #include <internal.h>
  20.  
  21. #pragma data_seg(".CRT$XIA")
  22. _PVFV __xi_a[] = { NULL };
  23.  
  24. #pragma data_seg(".CRT$XIZ")
  25. _PVFV __xi_z[] = { NULL };
  26.  
  27. #pragma data_seg(".CRT$XCA")
  28. _PVFV __xc_a[] = { NULL };
  29.  
  30. #pragma data_seg(".CRT$XCZ")
  31. _PVFV __xc_z[] = { NULL };
  32.  
  33. #pragma data_seg()  /* reset */
  34.  
  35.  
  36. #pragma comment(linker, "/merge:.CRT=.data")
  37.  
  38. #pragma comment(linker, "/defaultlib:kernel32.lib")
  39.  
  40. #pragma comment(linker, "/disallowlib:libc.lib")
  41. #pragma comment(linker, "/disallowlib:libcd.lib")
  42. #pragma comment(linker, "/disallowlib:libcmt.lib")
  43. #pragma comment(linker, "/disallowlib:libcmtd.lib")
  44. #ifdef _DEBUG
  45. #pragma comment(linker, "/disallowlib:msvcrt.lib")
  46. #else  /* _DEBUG */
  47. #pragma comment(linker, "/disallowlib:msvcrtd.lib")
  48. #endif  /* _DEBUG */
  49.  
  50. #else  /* _MAC */
  51.  
  52. #include <cruntime.h>
  53. #include <msdos.h>
  54. #include <stdio.h>
  55. #include <stdlib.h>
  56. #include <internal.h>
  57. #include <fltintrn.h>
  58. #include <mpw.h>
  59. #include <mtdll.h>
  60. #include <macos\types.h>
  61. #include <macos\segload.h>
  62. #include <macos\gestalte.h>
  63. #include <macos\osutils.h>
  64. #include <macos\traps.h>
  65.  
  66. /*
  67.  * pointers to initialization functions
  68.  */
  69.  
  70. #pragma data_seg(".CRT$XIA")
  71. PFV __xi_a = 0;  /* C initializers */
  72.  
  73. #pragma data_seg(".CRT$XIZ")
  74. PFV __xi_z      = 0;
  75.  
  76. #pragma data_seg(".CRT$XCA")
  77. PFV __xc_a = 0;  /* C++ initializers */
  78.  
  79. #pragma data_seg(".CRT$XCZ")
  80. PFV __xc_z = 0;
  81.  
  82. #pragma data_seg(".CRT$XPA")
  83. PFV __xp_a = 0;  /* C pre-terminators */
  84.  
  85. #pragma data_seg(".CRT$XPZ")
  86. PFV __xp_z = 0;
  87.  
  88. #pragma data_seg(".CRT$XTA")
  89. PFV __xt_a = 0;   /* C terminators */
  90.  
  91. #pragma data_seg(".CRT$XTZ")
  92. PFV __xt_z = 0;
  93.  
  94. #pragma data_seg()  /* reset */
  95.  
  96.  
  97. #ifdef _M_MPPC
  98.  
  99. #pragma comment(linker, "/defaultlib:interfac.lib")
  100.  
  101. #pragma comment(linker, "/disallowlib:libc.lib")
  102. #pragma comment(linker, "/disallowlib:libcd.lib")
  103. #ifdef _DEBUG
  104. #pragma comment(linker, "/disallowlib:msvcrt.lib")
  105. #else  /* _DEBUG */
  106. #pragma comment(linker, "/disallowlib:msvcrtd.lib")
  107. #endif  /* _DEBUG */
  108.  
  109. #endif  /* _M_MPPC */
  110.  
  111. #endif  /* _MAC */
  112.