VirtualBox

source: vbox/trunk/src/VBox/Runtime/include/internal/compiler-vcc.h@ 95834

Last change on this file since 95834 was 95834, checked in by vboxsync, 3 years ago

IPRT/nocrt: Call C & C++ initializers and terminators. TLS directory (not used by VBoxControl). bugref:10261

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: compiler-vcc.h 95834 2022-07-26 14:46:59Z vboxsync $ */
2/** @file
3 * IPRT - Internal header for the Visual C++ Compiler Support Code.
4 */
5
6/*
7 * Copyright (C) 2022 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef IPRT_INCLUDED_INTERNAL_compiler_vcc_h
28#define IPRT_INCLUDED_INTERNAL_compiler_vcc_h
29#ifndef RT_WITHOUT_PRAGMA_ONCE
30# pragma once
31#endif
32
33#include <iprt/types.h>
34
35/** @name Special sections.
36 * @{
37 */
38
39#ifdef IPRT_COMPILER_VCC_WITH_C_INIT_TERM_SECTIONS
40# pragma section(".CRT$XIA", read, long) /* start C initializers */
41# pragma section(".CRT$XIAA", read, long)
42# pragma section(".CRT$XIZ", read, long)
43
44# pragma section(".CRT$XPA", read, long) /* start early C terminators */
45# pragma section(".CRT$XPAA", read, long)
46# pragma section(".CRT$XPZ", read, long)
47
48# pragma section(".CRT$XTA", read, long) /* start C terminators */
49# pragma section(".CRT$XTAA", read, long)
50# pragma section(".CRT$XTZ", read, long)
51#endif
52
53#ifdef IPRT_COMPILER_VCC_WITH_CPP_INIT_SECTIONS
54# pragma warning(disable:5247) /* warning C5247: section '.CRT$XCA' is reserved for C++ dynamic initialization. Manually creating the section will interfere with C++ dynamic initialization and may lead to undefined behavior */
55# pragma warning(disable:5248) /* warning C5248: section '.CRT$XCA' is reserved for C++ dynamic initialization. Variables manually put into the section may be optimized out and their order relative to compiler generated dynamic initializers is unspecified */
56# pragma section(".CRT$XCA", read, long) /* start C++ initializers */
57# pragma section(".CRT$XCAA", read, long)
58# pragma section(".CRT$XCZ", read, long)
59#endif
60
61#ifdef IPRT_COMPILER_VCC_WITH_RTC_INIT_TERM_SECTIONS
62# pragma section(".rtc$IAA", read, long) /* start RTC initializers */
63# pragma section(".rtc$IZZ", read, long)
64
65# pragma section(".rtc$TAA", read, long) /* start RTC terminators */
66# pragma section(".rtc$TZZ", read, long)
67#endif
68
69#ifdef IPRT_COMPILER_VCC_WITH_TLS_CALLBACK_SECTIONS
70# pragma section(".CRT$XLA", read, long) /* start TLS callback */
71# pragma section(".CRT$XLAA", read, long)
72# pragma section(".CRT$XLZ", read, long)
73
74/** @todo what about .CRT$XDA? Dynamic TLS initializers. */
75#endif
76
77#ifdef IPRT_COMPILER_VCC_WITH_TLS_DATA_SECTIONS
78# pragma section(".tls", read, long) /* start TLS callback */
79# pragma section(".tls$ZZZ", read, long)
80
81/** @todo what about .CRT$XDA? Dynamic TLS initializers. */
82#endif
83
84/** @} */
85
86
87RT_C_DECLS_BEGIN
88
89int rtVccInitializersRunInit(void) RT_NOEXCEPT;
90void rtVccInitializersRunTerm(void) RT_NOEXCEPT;
91
92RT_C_DECLS_END
93
94
95#endif /* !IPRT_INCLUDED_INTERNAL_compiler_vcc_h */
96
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette