mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-04-20 03:01:31 -04:00
30 lines
732 B
C++
30 lines
732 B
C++
/*
|
|
* benchmarking.h
|
|
*
|
|
*/
|
|
|
|
#ifndef TOOLS_BENCHMARKING_H_
|
|
#define TOOLS_BENCHMARKING_H_
|
|
|
|
#include <stdexcept>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
// call before insecure benchmarking functionality
|
|
inline void insecure(string message, bool warning = true)
|
|
{
|
|
#ifdef INSECURE
|
|
if (warning)
|
|
cerr << "WARNING: insecure " << message << endl;
|
|
#else
|
|
(void)warning;
|
|
string msg = "You are trying to use insecure benchmarking functionality for "
|
|
+ message + ".\nYou can activate this at compile time "
|
|
"by adding -DINSECURE to the compiler options.\n"
|
|
"Make sure to run make clean as well.";
|
|
throw runtime_error(msg);
|
|
#endif
|
|
}
|
|
|
|
#endif /* TOOLS_BENCHMARKING_H_ */
|