X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=swcsa%2Futils%2Fbasics.h;h=01741b5e2b8d16aa223fc9b99f240bb218813443;hb=6ba83dea468496a31eb57bdbac9b257a5a191a26;hp=6e4b39b9de691924b049b46233ab92660f6d2fba;hpb=443151511a86083b21c1c06eb610f86b3aed35be;p=SXSI%2FTextCollection.git diff --git a/swcsa/utils/basics.h b/swcsa/utils/basics.h index 6e4b39b..01741b5 100755 --- a/swcsa/utils/basics.h +++ b/swcsa/utils/basics.h @@ -5,6 +5,10 @@ #ifndef BASICSINCLUDED #define BASICSINCLUDED +#ifdef __cplusplus +extern "C" { +#endif + // Includes #include @@ -19,13 +23,13 @@ // Memory management -#define malloc(n) Malloc(n) -#define free(p) Free(p) -#define realloc(p,n) Realloc(p,n) + //#define malloc(n) Malloc(n) + //#define free(p) Free(p) + //#define realloc(p,n) Realloc(p,n) -void *Malloc (int n); -void Free (void *p); -void *Realloc (void *p, int n); + //static void *Malloc (size_t n); + //static void Free (void *p); + //static void *Realloc (void *p, size_t n); // Data types @@ -49,7 +53,7 @@ void *Realloc (void *p, int n); #define W (32) // bits needed to represent a number between 0 and n -uint bits (uint n); +uint _bits (uint n); // returns e[p..p+len-1], assuming len <= W uint bitread (uint *e, uint p, uint len); // writes e[p..p+len-1] = s, assuming len <= W @@ -108,5 +112,8 @@ void bitzero2 (uint *e, uint p, uint len); } \ } \ } +#ifdef __cplusplus + } +#endif #endif