Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.2 KiB

  1. /***
  2. *cinitexe.c - C Run-Time Startup Initialization
  3. *
  4. * Copyright (c) 1992-2001, 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. *Revision History:
  15. * 03-19-92 SKS Module created (based on CRT0INIT.ASM)
  16. * 08-06-92 SKS Revised to use new section names and macros
  17. * 04-12-93 CFW Added xia..xiz initializers.
  18. * 10-20-93 SKS Add .DiRECTiVE section for MIPS, too!
  19. * 10-28-93 GJF Rewritten in C
  20. * 10-28-94 SKS Add user32.lib as a default library
  21. * 02-27-95 CFW Remove user32.lib as a default library
  22. * 06-22-95 CFW Add -disallowlib directives.
  23. * 07-04-95 CFW Fix PMac -disallowlib directives.
  24. * 06-27-96 GJF Replaced defined(_WIN32) with !defined(_MAC).
  25. * 04-28-99 PML Wrap __declspec(allocate()) in _CRTALLOC macro.
  26. * 05-17-99 PML Remove all Macintosh support.
  27. *
  28. *******************************************************************************/
  29. #include <stdio.h>
  30. #include <internal.h>
  31. #include <sect_attribs.h>
  32. #pragma data_seg(".CRT$XIA")
  33. _CRTALLOC(".CRT$XIA") _PVFV __xi_a[] = { NULL };
  34. #pragma data_seg(".CRT$XIZ")
  35. _CRTALLOC(".CRT$XIZ") _PVFV __xi_z[] = { NULL };
  36. #pragma data_seg(".CRT$XCA")
  37. _CRTALLOC(".CRT$XCA") _PVFV __xc_a[] = { NULL };
  38. #pragma data_seg(".CRT$XCZ")
  39. _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[] = { NULL };
  40. #pragma data_seg() /* reset */
  41. #if defined(_M_IA64)
  42. #pragma comment(linker, "/merge:.CRT=.rdata")
  43. #else
  44. #ifdef NT_BUILD
  45. #pragma comment(linker, "/merge:.CRT=.rdata")
  46. #else
  47. #pragma comment(linker, "/merge:.CRT=.data")
  48. #endif
  49. #endif
  50. #pragma comment(linker, "/defaultlib:kernel32.lib")
  51. #pragma comment(linker, "/disallowlib:libc.lib")
  52. #pragma comment(linker, "/disallowlib:libcd.lib")
  53. #pragma comment(linker, "/disallowlib:libcmt.lib")
  54. #pragma comment(linker, "/disallowlib:libcmtd.lib")
  55. #ifdef _DEBUG
  56. #pragma comment(linker, "/disallowlib:msvcrt.lib")
  57. #else /* _DEBUG */
  58. #pragma comment(linker, "/disallowlib:msvcrtd.lib")
  59. #endif /* _DEBUG */