Browse Source

add ANDROID utils

pull/4/merge
Max Lv 11 years ago
parent
commit
3ed7551ce1
1 changed files with 11 additions and 0 deletions
  1. 11
      src/utils.h

11
src/utils.h

@ -1,6 +1,15 @@
#ifndef _UTILS_H
#define _UTILS_H
#ifdef ANDROID
#include <android/log.h>
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, "shadowsocks", __VA_ARGS__))
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "shadowsocks", __VA_ARGS__))
#else
#define STR(x) #x
#define TOSTR(x) STR(x)
#define TIME_FORMAT "%F %T"
@ -19,6 +28,8 @@ while(0)
fprintf(stderr, "\e[01;35m %s ERROR: \e[0m" format "\n", timestr, ##__VA_ARGS__);}\
while(0)
#endif
void FATAL(const char *msg);
void ERROR(const char *s);
void usage(void);

Loading…
Cancel
Save