Add bench utils

This commit is contained in:
Alejandro Gallo 2022-10-03 17:11:33 +02:00
parent 50896e3cd0
commit 2cbff5c8c9
3 changed files with 35 additions and 0 deletions

20
.dir-locals.el Normal file
View 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
View File

@ -25,3 +25,6 @@ config.mk
/atrip.html /atrip.html
/TAGS /TAGS
/config.h.in /config.h.in
/result
/result-dev
/vendor/

12
bench/utils.hpp Normal file
View 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