]> www.ginac.de Git - cln.git/blobdiff - include/cln/integer_class.h
Replace CL_REQUIRE/CL_PROVIDE(cl_I_ring) with portable code.
[cln.git] / include / cln / integer_class.h
index ebf9b6ef260ff26bd46611b1498fd9ee3698c69a..23f5632ac55f1ca81ee835e1f9be9ef5f4536dda 100644 (file)
@@ -21,10 +21,18 @@ public:
        cl_I (const unsigned int);      // argument must be < 2^29
        cl_I (const long);
        cl_I (const unsigned long);
+#ifdef HAVE_LONGLONG
+       cl_I (const long long);
+       cl_I (const unsigned long long);
+#endif
        cl_I& operator= (const int);            // |argument| must be < 2^29
        cl_I& operator= (const unsigned int);   // argument must be < 2^29
        cl_I& operator= (const long);
        cl_I& operator= (const unsigned long);
+#ifdef HAVE_LONGLONG
+       cl_I& operator= (const long long);
+       cl_I& operator= (const unsigned long long);
+#endif
 // Other constructors.
        cl_I (const char *);
 // Private constructor.
@@ -33,7 +41,7 @@ public:
        cl_I (struct cl_heap_bignum *);
 public:        // Ability to place an object at a given address.
        void* operator new (size_t size) { return malloc_hook(size); }
-       void* operator new (size_t size, cl_I* ptr) { (void)size; return ptr; }
+       void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
        void operator delete (void* ptr) { free_hook(ptr); }
 };
 
@@ -51,6 +59,10 @@ CL_DEFINE_INT_CONSTRUCTORS(cl_I)
 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_I)
 CL_DEFINE_LONG_CONSTRUCTORS(cl_I)
 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_I)
+#ifdef HAVE_LONGLONG
+CL_DEFINE_LONGLONG_CONSTRUCTORS(cl_I)
+CL_DEFINE_LONGLONG_ASSIGNMENT_OPERATORS(cl_I)
+#endif
 
 }  // namespace cln