randomizw

android port

git-svn-id: svn://db.shs.com.ru/pip@39 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-03-23 08:49:21 +00:00
parent f89764d6bc
commit cef64a9b80
10 changed files with 40 additions and 16 deletions

View File

@@ -111,8 +111,8 @@
#ifdef ANDROID
# define tcdrain(fd) ioctl(fd, TCSBRK, 1)
inline int wctomb(char * c, wchar_t w) {*c = ((char * )&w)[0]; return 1;}
inline int mbtowc(wchar_t * w, const char * c, size_t) {*w = ((wchar_t * )&c)[0]; return 1;}
//inline int wctomb(char * c, wchar_t w) {*c = ((char * )&w)[0]; return 1;}
//inline int mbtowc(wchar_t * w, const char * c, size_t) {*w = ((wchar_t * )&c)[0]; return 1;}
#endif
#ifdef MAC_OS

View File

@@ -158,8 +158,9 @@ PIInit::PIInit() {
sinfo->user = ps->pw_name;
else {
memset(cbuff, 0, 1024);
if (getlogin_r(cbuff, 1023) == 0)
sinfo->user = cbuff;
char * l = getlogin();
if (l)
sinfo->user = l;
}
struct utsname uns;
if (uname(&uns) == 0) {

View File

@@ -81,6 +81,9 @@ const int PIString::fromBaseN[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -
#else
# define pisprintf(f, v) char ch[256]; memset(ch, 0, 256); sprintf_s(ch, 256, f, v);
#endif
#ifdef ANDROID
int wctomb(char * c, wchar_t w) {*c = ((char * )&w)[0]; return 1;}
#endif
PIString PIString::itos(const int num) {pisprintf("%d", num); return PIString(ch);}
PIString PIString::ltos(const long num) {pisprintf("%ld", num); return PIString(ch);}