mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Factor out common usage-help code
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// platform-specific hacks
|
||||
|
||||
#ifndef RGBDS_PLATFORM_HPP
|
||||
#define RGBDS_PLATFORM_HPP
|
||||
|
||||
|
||||
21
include/usage.hpp
Normal file
21
include/usage.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#ifndef RGBDS_USAGE_HPP
|
||||
#define RGBDS_USAGE_HPP
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
class Usage {
|
||||
char const *usage;
|
||||
|
||||
public:
|
||||
Usage(char const *usage_) : usage(usage_) {}
|
||||
|
||||
[[noreturn]]
|
||||
void printAndExit(int code) const;
|
||||
|
||||
[[gnu::format(printf, 2, 3), noreturn]]
|
||||
void printAndExit(char const *fmt, ...) const;
|
||||
};
|
||||
|
||||
#endif // RGBDS_USAGE_HPP
|
||||
Reference in New Issue
Block a user