You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

67 lines
1.7 KiB

  1. #ifndef __DECAF_H__
  2. #define __DECAF_H__ 1
  3. #include <stdint.h>
  4. #include <sys/types.h>
  5. /* Goldilocks' build flags default to hidden and stripping executables. */
  6. /** @cond internal */
  7. #if defined(DOXYGEN) && !defined(__attribute__)
  8. #define __attribute__((x))
  9. #endif
  10. #define API_VIS __attribute__((visibility("default")))
  11. #define NOINLINE __attribute__((noinline))
  12. #define WARN_UNUSED __attribute__((warn_unused_result))
  13. #define NONNULL1 __attribute__((nonnull(1)))
  14. #define NONNULL2 __attribute__((nonnull(1,2)))
  15. #define NONNULL3 __attribute__((nonnull(1,2,3)))
  16. #define NONNULL4 __attribute__((nonnull(1,2,3,4)))
  17. #define NONNULL5 __attribute__((nonnull(1,2,3,4,5)))
  18. /** @endcond */
  19. /* Internal word types */
  20. #if (defined(__ILP64__) || defined(__amd64__) || defined(__x86_64__) || (((__UINT_FAST32_MAX__)>>30)>>30)) \
  21. && !defined(DECAF_FORCE_32_BIT)
  22. #define DECAF_WORD_BITS 64
  23. typedef uint64_t decaf_word_t, decaf_bool_t;
  24. typedef __uint128_t decaf_dword_t;
  25. #else
  26. #define DECAF_WORD_BITS 32
  27. typedef uint32_t decaf_word_t, decaf_bool_t;
  28. typedef uint64_t decaf_dword_t;
  29. #endif
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /** DECAF_TRUE = -1 so that DECAF_TRUE & x = x */
  34. static const decaf_bool_t DECAF_TRUE = -(decaf_bool_t)1, DECAF_FALSE = 0;
  35. /** NB Success is -1, failure is 0. TODO: see if people would rather the reverse. */
  36. static const decaf_bool_t DECAF_SUCCESS = -(decaf_bool_t)1 /*DECAF_TRUE*/,
  37. DECAF_FAILURE = 0 /*DECAF_FALSE*/;
  38. #include "decaf_255.h"
  39. #include "decaf_448.h"
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43. #undef API_VIS
  44. #undef WARN_UNUSED
  45. #undef NOINLINE
  46. #undef NONNULL1
  47. #undef NONNULL2
  48. #undef NONNULL3
  49. #undef NONNULL4
  50. #undef NONNULL5
  51. #endif /* __DECAF_H__ */