aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2018-11-30 16:30:43 +0000
committerMichalis Spyrou <michalis.spyrou@arm.com>2018-12-03 13:47:53 +0000
commit323ce0f0b06bca785959913e75e1f51d383c351a (patch)
treedc3729e19a43d8290285987c51d9799581412c33 /src/core
parent08a4517905da959b6e3401cc24f5e2018f9b51ac (diff)
downloadComputeLibrary-323ce0f0b06bca785959913e75e1f51d383c351a.tar.gz
COMPMID-1819 Add option to build library with -fno-exceptions
Change-Id: I3de6bb33746d52f8d8c337ab7776eccee8c205fb Reviewed-on: https://review.mlplatform.org/328 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-by: Pablo Marquez <pablo.tello@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Error.cpp4
-rw-r--r--src/core/Utils.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/core/Error.cpp b/src/core/Error.cpp
index 2f6a94bb85..e7b43655a2 100644
--- a/src/core/Error.cpp
+++ b/src/core/Error.cpp
@@ -54,9 +54,9 @@ void arm_compute::error(const char *function, const char *file, const int line,
va_start(args, msg);
auto err = create_error_va_list(ErrorCode::RUNTIME_ERROR, function, file, line, msg, args);
va_end(args);
- throw std::runtime_error(err.error_description());
+ ARM_COMPUTE_THROW(std::runtime_error(err.error_description()));
}
void Status::internal_throw_on_error() const
{
- throw std::runtime_error(_error_description);
+ ARM_COMPUTE_THROW(std::runtime_error(_error_description));
}
diff --git a/src/core/Utils.cpp b/src/core/Utils.cpp
index 39dad8f581..6080dc45ba 100644
--- a/src/core/Utils.cpp
+++ b/src/core/Utils.cpp
@@ -48,8 +48,10 @@ std::string arm_compute::read_file(const std::string &filename, bool binary)
std::string out;
std::ifstream fs;
+#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
try
{
+#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
fs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
std::ios_base::openmode mode = std::ios::in;
@@ -68,11 +70,13 @@ std::string arm_compute::read_file(const std::string &filename, bool binary)
fs.seekg(0, std::ios::beg);
// Copy the content of the file
out.assign(std::istreambuf_iterator<char>(fs), std::istreambuf_iterator<char>());
+#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
}
catch(const std::ifstream::failure &e)
{
ARM_COMPUTE_ERROR("Accessing %s: %s", filename.c_str(), e.what());
}
+#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
return out;
}