fix: 修复msvc不支持_Noreturn
This commit is contained in:
@@ -6,7 +6,7 @@ import os
|
|||||||
|
|
||||||
class loggingRecipe(ConanFile):
|
class loggingRecipe(ConanFile):
|
||||||
name = "cargparse"
|
name = "cargparse"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
author = "321640253@qq.com"
|
author = "321640253@qq.com"
|
||||||
url = "https://gitea.youmetme.wang/youmetme/logging"
|
url = "https://gitea.youmetme.wang/youmetme/logging"
|
||||||
|
|||||||
@@ -7,6 +7,14 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define NORETURN __declspec(noreturn)
|
||||||
|
#else
|
||||||
|
#define NORETURN _Noreturn
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define ARG_DEFAULT_HELP_FLAG "--help"
|
#define ARG_DEFAULT_HELP_FLAG "--help"
|
||||||
|
|
||||||
typedef struct ArgParse ArgParse; // 解析器
|
typedef struct ArgParse ArgParse; // 解析器
|
||||||
@@ -303,7 +311,7 @@ char *argParseGenerateHelp(ArgParse *argParse);
|
|||||||
char *
|
char *
|
||||||
argParseGenerateArgErrorMsg(ArgParse *argParse, char *name, bool short_flag);
|
argParseGenerateArgErrorMsg(ArgParse *argParse, char *name, bool short_flag);
|
||||||
|
|
||||||
_Noreturn void argParseError(ArgParse *argParse,
|
NORETURN void argParseError(ArgParse *argParse,
|
||||||
Command *lastCommand,
|
Command *lastCommand,
|
||||||
const char *prefix,
|
const char *prefix,
|
||||||
const char *suffix);
|
const char *suffix);
|
||||||
|
|||||||
@@ -818,7 +818,7 @@ bool argParseCheckCommandTriggered(ArgParse *argParse, char *command_name) {
|
|||||||
return command->is_trigged;
|
return command->is_trigged;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Noreturn void argParseError(ArgParse *argParse,
|
NORETURN void argParseError(ArgParse *argParse,
|
||||||
Command *lastCommand,
|
Command *lastCommand,
|
||||||
const char *prefix,
|
const char *prefix,
|
||||||
const char *suffix) {
|
const char *suffix) {
|
||||||
|
|||||||
Reference in New Issue
Block a user