From f78a30aaccffddc3e3eab07870e02157322af956 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sun, 12 Apr 2026 13:29:59 -0400 Subject: Header shuffle, update deps Signed-off-by: Andrew Opalach --- tests/command_line_args.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/command_line_args.c (limited to 'tests/command_line_args.c') diff --git a/tests/command_line_args.c b/tests/command_line_args.c new file mode 100644 index 0000000..cda9328 --- /dev/null +++ b/tests/command_line_args.c @@ -0,0 +1,31 @@ +#ifndef _UNICODE +#define _UNICODE +#endif +#ifndef UNICODE +#define UNICODE +#endif +#include +#include +#include +#include + +#ifdef NAUNET_ON_WINDOWS +s32 wmain(s32 argc, wchar_t **argv) +#else +s32 main(s32 argc, char *argv[]) +#endif +{ + if (!nn_common_init(NULL)) { + return EXIT_FAILURE; + } + + for (s32 i = 0; i < argc; i++) { +#ifdef NAUNET_ON_WINDOWS + al_printf("%d: %ls %zu\n", i, argv[i], al_wcsnlen(argv[i], MAX_ALLOC_32 / sizeof(wchar_t))); +#else + al_printf("%d: %.*s %zu\n", i, al_str_x(&al_str_cr(argv[i])), al_strlen(argv[i])); +#endif + } + + return EXIT_SUCCESS; +} -- cgit v1.2.3-101-g0448