This commit is contained in:
2022-02-15 13:42:40 +08:00
parent 0c8dba0a0a
commit a64c19d111
4 changed files with 39 additions and 0 deletions

12
err.h
View File

@@ -1,5 +1,6 @@
#ifndef _UTILS_ERR_H
#define _UTILS_ERR_H
#if __cplusplus
#include <string>
namespace err {
@@ -11,4 +12,15 @@ namespace err {
*/
bool get_errno_message(std::string &out, int errnum);
}
extern "C" {
#endif
/**
* @brief Get error message from errno
* @param errnum errno
* @return Output string. Need free memory by calling free.
*/
char* err_get_errno_message(int errnum);
#if __cplusplus
}
#endif
#endif