From a39bae74ecf34b913a65c1fbf7f974faf714546c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vitaliy=20Cherepanov/AI=20Tools=20Lab=20/SRR/Engineer/?= =?utf8?q?=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 31 Jul 2018 17:33:04 +0300 Subject: [PATCH] nnc: fix def2src generator (#812) add ifndef define endif strucure to header Signed-off-by: Vitaliy Cherepanov --- contrib/nnc/libs/backend/soft/src/def2src.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/nnc/libs/backend/soft/src/def2src.cpp b/contrib/nnc/libs/backend/soft/src/def2src.cpp index dd67d16..57b64a9 100644 --- a/contrib/nnc/libs/backend/soft/src/def2src.cpp +++ b/contrib/nnc/libs/backend/soft/src/def2src.cpp @@ -17,6 +17,9 @@ int fileToArray(std::string &source, std::string &dest, std::string arrName) { std::cout << "generating <" << dest << ">" << std::endl; + fo << "#ifndef _" << arrName << "_H_" << std::endl; + fo << "#define _" << arrName << "_H_" << std::endl; + fo << "const char " << arrName << "[] = {" << std::endl; fseek(fs, 0, SEEK_SET); @@ -32,6 +35,10 @@ int fileToArray(std::string &source, std::string &dest, std::string arrName) { } while (bytes != 0); fo << "};" << std::endl; + + fo << std::endl; + fo << "#endif /* _" << arrName << "_H_ */" << std::endl; + fo.flush(); fclose(fs); -- 2.7.4