add macros part

This commit is contained in:
chatlanin 2023-08-10 11:19:35 +03:00
parent fc758f8cd9
commit 0339df9279
2 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,7 @@
#include "hack/security/is_string.hpp"
#include "hack/security/is_link.hpp"
#include "hack/string/utf8_len.hpp"
#include "hack/macros/macros.hpp"
// for example
int f(int a)
@ -339,4 +340,12 @@ int main(int argc, char *argv[])
s = hack::string::utf8_len("asdf");
hack::log()(s);
}
hack::log()("============================================================");
hack::log()("macros");
{// ex: macros make_string
std::string s { MAKE_STR(test string) };
hack::log()(s);
}
}

View File

@ -0,0 +1,3 @@
#define MAKE_STR2(x) #x
#define MAKE_STR(x) MAKE_STR2(x)