Add bench utils
This commit is contained in:
parent
50896e3cd0
commit
2cbff5c8c9
20
.dir-locals.el
Normal file
20
.dir-locals.el
Normal file
@ -0,0 +1,20 @@
|
||||
;;; Directory Local Variables
|
||||
;;; For more information see (info "(emacs) Directory Variables")
|
||||
|
||||
((c++-mode . ((outline-regexp . "// \\[\\[file:")
|
||||
(eval . (let
|
||||
((root
|
||||
(expand-file-name
|
||||
(project-root
|
||||
(project-current)))))
|
||||
(setq-local flycheck-gcc-include-path
|
||||
(list
|
||||
(format "%s/vendor/include/" root)
|
||||
(format "%s/include/" root)
|
||||
(format "%s/" root)
|
||||
(format "%s/bench/" root)
|
||||
(format "%s/build/main/" root)))))
|
||||
(eval . (flycheck-mode))
|
||||
(eval . (outline-minor-mode))
|
||||
(indent-tabs-mode . nil)
|
||||
(tab-width . 2))))
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -25,3 +25,6 @@ config.mk
|
||||
/atrip.html
|
||||
/TAGS
|
||||
/config.h.in
|
||||
/result
|
||||
/result-dev
|
||||
/vendor/
|
||||
|
||||
12
bench/utils.hpp
Normal file
12
bench/utils.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef UTILS_HPP_
|
||||
#define UTILS_HPP_
|
||||
|
||||
#define _FORMAT(_fmt, ...) \
|
||||
([&] (void) -> std::string { \
|
||||
int _sz = std::snprintf(nullptr, 0, _fmt, __VA_ARGS__); \
|
||||
std::vector<char> _out(_sz + 1); \
|
||||
std::snprintf(&_out[0], _out.size(), _fmt, __VA_ARGS__); \
|
||||
return std::string(_out.data()); \
|
||||
})()
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user