| 23 | #include <mutex> |
| 24 | |
| 25 | void str2buf(const std::string& str, char* buf, int n) { |
| 26 | if (str.size() < static_cast<unsigned int>(n)) { |
| 27 | strncpy(buf, str.c_str(), n - 1); |
| 28 | buf[n - 1] = '\0'; |
| 29 | } else { |
| 30 | throw CoolProp::ValueError("Buffer is too small; must be at least " + std::to_string(str.size()) + " characters in size"); |
| 31 | } |
| 32 | } |
| 33 | void HandleException(long* errcode, char* message_buffer, const long buffer_length) { |
| 34 | try { |
| 35 | throw; // Rethrow the error, and here we handle the error |
no test coverage detected