From 30dd11d0c9654ee890497aa249fca7e4e732fc47 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 3 Feb 2022 10:54:07 +0000 Subject: fix: move to c99 --- include/viv/cli.h | 4 ++-- include/viv/flag.h | 2 ++ include/viv/ssl.h | 3 +++ include/viv/viv.h | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/viv/cli.h b/include/viv/cli.h index 727fa53..3445fcc 100644 --- a/include/viv/cli.h +++ b/include/viv/cli.h @@ -8,11 +8,11 @@ #include -static const char *CLI_help = "usage: %s [option] [port]\n" +/* static const char *CLI_help = "usage: %s [option] [port]\n" "options:\n" " -c, --cert print the received certificates\n" " -h, --help you are here\n" - " -v, --version print viv's version information\n"; + " -v, --version print viv's version information\n"; */ typedef enum { CLI_option_SHOW_CERTS = (1 << 0), diff --git a/include/viv/flag.h b/include/viv/flag.h index b52f941..cdd7c16 100644 --- a/include/viv/flag.h +++ b/include/viv/flag.h @@ -5,6 +5,8 @@ #ifndef FLAG_H_ #define FLAG_H_ +#define static_assert _Static_assert + #include #include #include diff --git a/include/viv/ssl.h b/include/viv/ssl.h index 6d4ace2..8e11d39 100644 --- a/include/viv/ssl.h +++ b/include/viv/ssl.h @@ -6,6 +6,9 @@ #pragma once +/* https://stackoverflow.com/a/11405862/14452787 */ +#define h_addr h_addr_list[0] + #include /* Definitions within this header will be prefixed by VIV_SSL opposed to just diff --git a/include/viv/viv.h b/include/viv/viv.h index 82c7583..bbb608c 100644 --- a/include/viv/viv.h +++ b/include/viv/viv.h @@ -8,10 +8,12 @@ typedef void(*split_fn)(const char *, int, void *); -static const char *VIV_version = "1.0.0"; +/* static const char *VIV_version = "1.0.0"; */ int VIV_exit(int, const char *, ...); /* http://www.martinbroadhurst.com/split-a-string-in-c.html */ void VIV_split(const char *, char, split_fn, void *); +char *strsep(char **__restrict, const char *__restrict); + #endif /* VIV_VIV_H */ -- cgit v1.2.3