\doxysection{Startup.\+h} \hypertarget{_startup_8h_source}{}\label{_startup_8h_source}\index{Include/Utility/Startup.h@{Include/Utility/Startup.h}} \begin{DoxyCode}{0} \DoxyCodeLine{00001\ \textcolor{comment}{//\ =====================================================================================================================}} \DoxyCodeLine{00002\ \textcolor{comment}{//\ Copyright\ 2024\ Medusa\ Slockbower}} \DoxyCodeLine{00003\ \textcolor{comment}{//\ Licensed\ under\ the\ Apache\ License,\ Version\ 2.0\ (the\ "{}License"{});}} \DoxyCodeLine{00004\ \textcolor{comment}{//\ you\ may\ not\ use\ this\ file\ except\ in\ compliance\ with\ the\ License.}} \DoxyCodeLine{00005\ \textcolor{comment}{//\ You\ may\ obtain\ a\ copy\ of\ the\ License\ at}} \DoxyCodeLine{00006\ \textcolor{comment}{//}} \DoxyCodeLine{00007\ \textcolor{comment}{//\ \ http://www.apache.org/licenses/LICENSE-\/2.0}} \DoxyCodeLine{00008\ \textcolor{comment}{//}} \DoxyCodeLine{00009\ \textcolor{comment}{//\ Unless\ required\ by\ applicable\ law\ or\ agreed\ to\ in\ writing,\ software}} \DoxyCodeLine{00010\ \textcolor{comment}{//\ distributed\ under\ the\ License\ is\ distributed\ on\ an\ "{}AS\ IS"{}\ BASIS,}} \DoxyCodeLine{00011\ \textcolor{comment}{//\ WITHOUT\ WARRANTIES\ OR\ CONDITIONS\ OF\ ANY\ KIND,\ either\ express\ or\ implied.}} \DoxyCodeLine{00012\ \textcolor{comment}{//\ See\ the\ License\ for\ the\ specific\ language\ governing\ permissions\ and}} \DoxyCodeLine{00013\ \textcolor{comment}{//\ limitations\ under\ the\ License.}} \DoxyCodeLine{00014\ \textcolor{comment}{//\ =====================================================================================================================}} \DoxyCodeLine{00015\ } \DoxyCodeLine{00016\ \textcolor{preprocessor}{\#ifndef\ STARTUP\_H}} \DoxyCodeLine{00017\ \textcolor{preprocessor}{\#define\ STARTUP\_H}} \DoxyCodeLine{00018\ } \DoxyCodeLine{00019\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}} \DoxyCodeLine{00020\ \textcolor{preprocessor}{\#define\ STARTUP(f)\ \(\backslash\)}} \DoxyCodeLine{00021\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void);\ \(\backslash\)}} \DoxyCodeLine{00022\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ struct\ f\#\#\_t\_\ \{\ f\#\#\_t\_(void)\ \{\ f();\ \}\ \};\ inline\ static\ f\#\#\_t\_\ f\#\#\_;\ \(\backslash\)}} \DoxyCodeLine{00023\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void)}} \DoxyCodeLine{00024\ \textcolor{preprocessor}{\#elif\ defined(\_MSC\_VER)}} \DoxyCodeLine{00025\ \textcolor{preprocessor}{\#pragma\ section("{}.CRT\$XCU"{},read)}} \DoxyCodeLine{00026\ \textcolor{preprocessor}{\ \ \ \ \#define\ INITIALIZER2\_(f,p)\ \(\backslash\)}} \DoxyCodeLine{00027\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void);\ \(\backslash\)}} \DoxyCodeLine{00028\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \_\_declspec(allocate("{}.CRT\$XCU"{}))\ void\ (*f\#\#\_)(void)\ =\ f;\ \(\backslash\)}} \DoxyCodeLine{00029\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \_\_pragma(comment(linker,"{}/include:"{}\ p\ \#f\ "{}\_"{}))\ \(\backslash\)}} \DoxyCodeLine{00030\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void)}} \DoxyCodeLine{00031\ \textcolor{preprocessor}{\ \ \ \ \#ifdef\ \_WIN64}} \DoxyCodeLine{00032\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#define\ STARTUP(f)\ INITIALIZER2\_(f,"{}"{})}} \DoxyCodeLine{00033\ \textcolor{preprocessor}{\ \ \ \ \#else}} \DoxyCodeLine{00034\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#define\ STARTUP(f)\ INITIALIZER2\_(f,"{}\_"{})}} \DoxyCodeLine{00035\ \textcolor{preprocessor}{\ \ \ \ \#endif}} \DoxyCodeLine{00036\ \textcolor{preprocessor}{\#else}} \DoxyCodeLine{00037\ \textcolor{preprocessor}{\ \ \ \ \#define\ STARTUP(f)\ \(\backslash\)}} \DoxyCodeLine{00038\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void)\ \_\_attribute\_\_((constructor));\ \(\backslash\)}} \DoxyCodeLine{00039\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void)}} \DoxyCodeLine{00040\ \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{00041\ } \DoxyCodeLine{00042\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//STARTUP\_H}} \end{DoxyCode}