mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-03 16:45:53 +00:00
add ANDROID utils
This commit is contained in:
+11
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user