CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
entry.h
1#pragma once
2
3// Platform-independent entry point
4
6#include <cx/cx.h>
7#include <cx/platform/base.h>
8
9// Command-line arguments (UTF-8)
10extern string cmdProgram;
11extern sa_string cmdArgs;
12
13// DEFINE_ENTRY_POINT
14// Put this macro in a translation unit somewhere to define the platform
15// dependent entry point, which will parse the command-line arguments and
16// call entryPoint()
17
18CX_C_BEGIN
19
20// User-supplied function that is called by DEFINE_ENTRY_POINT
21int entryPoint();
22
23// Internal support functions, do not call these directly
24void _entryParseArgs(int argc, const char** argv);
25void _entryParseArgsU16(int argc, const uint16** argv);
26
27#if defined(_PLATFORM_WIN)
28#include "cx/platform/win/win_sys_entry.h"
29#elif defined(_PLATFORM_UNIX)
30#include "cx/platform/unix/unix_sys_entry.h"
31#elif defined(_PLATFORM_WASM)
32#include "cx/platform/wasm/wasm_sys_entry.h"
33#endif
34
35CX_C_END
Compiler and platform detection macros.
Dynamic arrays with type-safe generic programming.