\doxysection{startup.\+h} \hypertarget{startup_8h_source}{}\label{startup_8h_source} \begin{DoxyCode}{0} \DoxyCodeLine{00001\ \textcolor{comment}{//\ =====================================================================================================================}} \DoxyCodeLine{00002\ \textcolor{comment}{//\ \ open-\/cpp-\/utils,\ an\ open-\/source\ cpp\ library\ with\ data\ structures\ that\ extend\ the\ STL.}} \DoxyCodeLine{00003\ \textcolor{comment}{//\ \ Copyright\ (C)\ 2024\ \ Medusa\ Slockbower}} \DoxyCodeLine{00004\ \textcolor{comment}{//}} \DoxyCodeLine{00005\ \textcolor{comment}{//\ \ This\ program\ is\ free\ software:\ you\ can\ redistribute\ it\ and/or\ modify}} \DoxyCodeLine{00006\ \textcolor{comment}{//\ \ it\ under\ the\ terms\ of\ the\ GNU\ General\ Public\ License\ as\ published\ by}} \DoxyCodeLine{00007\ \textcolor{comment}{//\ \ the\ Free\ Software\ Foundation,\ either\ version\ 3\ of\ the\ License,\ or}} \DoxyCodeLine{00008\ \textcolor{comment}{//\ \ (at\ your\ option)\ any\ later\ version.}} \DoxyCodeLine{00009\ \textcolor{comment}{//}} \DoxyCodeLine{00010\ \textcolor{comment}{//\ \ This\ program\ is\ distributed\ in\ the\ hope\ that\ it\ will\ be\ useful,}} \DoxyCodeLine{00011\ \textcolor{comment}{//\ \ but\ WITHOUT\ ANY\ WARRANTY;\ without\ even\ the\ implied\ warranty\ of}} \DoxyCodeLine{00012\ \textcolor{comment}{//\ \ MERCHANTABILITY\ or\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE.\ \ See\ the}} \DoxyCodeLine{00013\ \textcolor{comment}{//\ \ GNU\ General\ Public\ License\ for\ more\ details.}} \DoxyCodeLine{00014\ \textcolor{comment}{//}} \DoxyCodeLine{00015\ \textcolor{comment}{//\ \ You\ should\ have\ received\ a\ copy\ of\ the\ GNU\ General\ Public\ License}} \DoxyCodeLine{00016\ \textcolor{comment}{//\ \ along\ with\ this\ program.\ \ If\ not,\ see\ .}} \DoxyCodeLine{00017\ \textcolor{comment}{//\ =====================================================================================================================}} \DoxyCodeLine{00018\ } \DoxyCodeLine{00019\ \textcolor{preprocessor}{\#ifndef\ OPEN\_CPP\_UTILS\_STARTUP\_H}} \DoxyCodeLine{00020\ \textcolor{preprocessor}{\#define\ OPEN\_CPP\_UTILS\_STARTUP\_H}} \DoxyCodeLine{00021\ } \DoxyCodeLine{00022\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}} \DoxyCodeLine{00023\ \textcolor{preprocessor}{\#define\ STARTUP(f)\ \(\backslash\)}} \DoxyCodeLine{00024\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ inline\ static\ void\ f(void);\ \(\backslash\)}} \DoxyCodeLine{00025\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ struct\ f\#\#\_t\_\ \{\ inline\ f\#\#\_t\_(void)\ \{\ f();\ \}\ \};\ inline\ static\ f\#\#\_t\_\ f\#\#\_;\ \(\backslash\)}} \DoxyCodeLine{00026\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ inline\ static\ void\ f(void)}} \DoxyCodeLine{00027\ \textcolor{preprocessor}{\#elif\ defined(\_MSC\_VER)}} \DoxyCodeLine{00028\ \textcolor{preprocessor}{\#pragma\ section("{}.CRT\$XCU"{},read)}} \DoxyCodeLine{00029\ \textcolor{preprocessor}{\ \ \ \ \#define\ INITIALIZER2\_(f,p)\ \(\backslash\)}} \DoxyCodeLine{00030\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void);\ \(\backslash\)}} \DoxyCodeLine{00031\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \_\_declspec(allocate("{}.CRT\$XCU"{}))\ void\ (*f\#\#\_)(void)\ =\ f;\ \(\backslash\)}} \DoxyCodeLine{00032\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \_\_pragma(comment(linker,"{}/include:"{}\ p\ \#f\ "{}\_"{}))\ \(\backslash\)}} \DoxyCodeLine{00033\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void)}} \DoxyCodeLine{00034\ \textcolor{preprocessor}{\ \ \ \ \#ifdef\ \_WIN64}} \DoxyCodeLine{00035\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#define\ STARTUP(f)\ INITIALIZER2\_(f,"{}"{})}} \DoxyCodeLine{00036\ \textcolor{preprocessor}{\ \ \ \ \#else}} \DoxyCodeLine{00037\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#define\ STARTUP(f)\ INITIALIZER2\_(f,"{}\_"{})}} \DoxyCodeLine{00038\ \textcolor{preprocessor}{\ \ \ \ \#endif}} \DoxyCodeLine{00039\ \textcolor{preprocessor}{\#else}} \DoxyCodeLine{00040\ \textcolor{preprocessor}{\ \ \ \ \#define\ STARTUP(f)\ \(\backslash\)}} \DoxyCodeLine{00041\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void)\ \_\_attribute\_\_((constructor));\ \(\backslash\)}} \DoxyCodeLine{00042\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ static\ void\ f(void)}} \DoxyCodeLine{00043\ \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{00044\ } \DoxyCodeLine{00045\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ OPEN\_CPP\_UTILS\_STARTUP\_H}} \end{DoxyCode}