Clearmatics Libsnark
0.1
C++ library for zkSNARK proofs
|
Go to the documentation of this file.
13 #include <libff/common/utils.hpp>
17 #ifndef __infrastructure_HPP
18 #define __infrastructure_HPP
20 #ifndef _MSC_VER // emulate the MSVC-specific sprintf_s using the standard
23 snprintf // TODO: sprintf_s!=snprintf
27 #ifdef _DEBUG // MSVC Debug build
28 #define DEBUG // gcc Debug flag
36 #define DISALLOW_CONSTRUCTION(TypeName) TypeName();
40 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
41 TypeName(const TypeName &); \
42 void operator=(const TypeName &)
64 #if defined(_MSC_VER) // VisualC++
65 #define __noreturn _declspec(noreturn)
66 #elif defined(__GNUC__)
67 #define __noreturn __attribute__((noreturn))
85 #define GADGETLIB_FATAL(msg) \
87 ::std::stringstream msgStream; \
88 msgStream << msg << " (In file " << __FILE__ << " line " << __LINE__ \
90 ErrorHandling::fatalError(msgStream.str()); \
94 #define GADGETLIB_ASSERT(predicate, msg) \
95 if (!(bool(predicate))) \
102 double Log2(
double n);
118 inline int64_t
POW2(
int exponent)
121 return ((int64_t)1) << exponent;
125 inline int64_t
CEIL(
double a) {
return (int64_t)ceil(a); }
131 #endif // __infrastructure_HPP
::std::string GADGETLIB2_FMT(const char *format,...)
static void __noreturn fatalError(const ::std::string &msg)
int64_t POW2(int exponent)
long safeConvert(const int64_t num)
static void printStacktrace()
unsigned int Log2ceil(uint64_t i)
bool IsPower2(const long x)
Returns true iff x is a power of 2.