| | |
| | | extern "C" { |
| | | #endif |
| | | |
| | | /// @brief Compare And Swap |
| | | /// If the current value of *a_ptr is a_oldVal, then write a_newVal into *a_ptr |
| | | /// @return true if the comparison is successful and a_newVal was written |
| | | #define CAS(a_ptr, a_oldVal, a_newVal) __sync_bool_compare_and_swap(a_ptr, a_oldVal, a_newVal) |
| | | |
| | | #if ! defined(__FreeBSD__) && ! defined(__OpenBSD__) && \ |
| | | ! defined(__sgi) && ! defined(__APPLE__) |
| | |
| | | |
| | | #endif |
| | | |
| | | #ifdef _WIN32 |
| | | #define PATH_SEPERATOR "\\" |
| | | #else |
| | | #define PATH_SEPERATOR "/" |
| | | #endif |
| | | |
| | | /* Default file permissions are DEF_MODE & ~DEF_UMASK */ |
| | | #define DEF_MODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH |
| | |
| | | #define MIN(a,b) ((a) < (b) ? (a) : (b)) |
| | | #define MAX(a,b) ((a) > (b) ? (a) : (b)) |
| | | |
| | | |
| | | #define BLANK "\t\n\v\f\r " |
| | | /* Misc constants */ |
| | | #define MAXLINE 1024 /* Max text line length */ |
| | | #define MAXBUF 8192 /* Max I/O buffer size */ |