// // common_const.h // RA TradeFiling // // Created by Rui Zhang on 11/18/20. // #ifndef common_const_h #define common_const_h #define DEBUGLOG 1 #ifdef DEBUGLOG #ifdef DEBUG // #define DebugLog( s, ... ) fprintf(stderr,"%s\n",[[NSString stringWithFormat:s, ##__VA_ARGS__] UTF8String])// #define DebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] ) #define blockDebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n",weakself, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] ) #else #define DebugLog( s, ... ) #define blockDebugLog( s, ... ) #endif #else #define DebugLog( s, ... ) #define blockDebugLog( s, ... ) #endif #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] #define UIColorFromRGBAlpha(rgbValue,alp) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(alp)] // 接口json 的result值 #define RESULT_LOGIN_ON_OTHER_DEVICE -1 #define RESULT_NO_RESPONSE -1024 #define RESULT_NET_ERROR -3 #define RESULT_NET_NOTAVAILABLE -4 #define RESULT_ERROR -5 #define RESULT_LOCALFILE_ERROR -7 #define RESULT_USERAUTH_ERROR -9 #define RESULT_VER_LOW -15 //#define RESULT_FALSE 0 #define RESULT_FALSE 1 #define RESULT_TRUE 2 #define RESULT_FAILED_WITH_MESSAGE 9 #define RESULT_TIMEOUT 99 // 对应接口状态的部分message #define MSG_NET_NOTAVAILABLE @"No available network, please check your network setting." #define MSG_NET_ERROR @"Net Error. Cannot connect to server for now. Please retry later." #define MSG_USERAUTH_ERROR @"Username or password is incorrect.Please check." #define MSG_VER_LOW @"Current App version is out of date, please update to the latest version." #define MSG_ERROR @"Connection failed with Server, please email your IT Admin."//@"Some error occured on server." #define MSG_SUCCESS @"Success." #define MSG_LOGIN_DEVICE @"You are currently signed in on another device. Please check." #define MSG_TIMEOUT @"Request timeout." #endif /* common_const_h */