c_utils.h 661 B

123456789101112131415161718192021222324252627
  1. #ifndef log_h
  2. #define log_h
  3. #include <android/log.h>
  4. #include <jni.h>
  5. #define LOG_TAG "tmessages_native"
  6. #ifndef LOG_DISABLED
  7. #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
  8. #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
  9. #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
  10. #define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
  11. #else
  12. #define LOGI(...)
  13. #define LOGD(...)
  14. #define LOGE(...)
  15. #define LOGV(...)
  16. #endif
  17. #ifndef MAX
  18. #define MAX(x, y) ((x) > (y)) ? (x) : (y)
  19. #endif
  20. #ifndef MIN
  21. #define MIN(x, y) ((x) < (y)) ? (x) : (y)
  22. #endif
  23. #endif