| diff -Naur src-orig/Android.mk src/Android.mk |
| --- src-orig/Android.mk 1969-12-31 19:00:00.000000000 -0500 |
| +++ src/Android.mk 2012-08-01 09:45:59.240318503 -0400 |
| @@ -0,0 +1,25 @@ |
| +LOCAL_PATH := $(call my-dir) |
| +include $(CLEAR_VARS) |
| + |
| +LT_VERSION = "0:1" |
| +LT_RELEASE = "1.8" |
| +SHARED_FLAGS = "-no-undefined" |
| + |
| +LOCAL_CPPFLAGS += -Wno-psabi -frtti -pthread -fexceptions |
| +LOCAL_MODULE := libccgnu2 |
| +LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib |
| + |
| +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../inc |
| + |
| +LOCAL_SRC_FILES := thread.cpp mutex.cpp semaphore.cpp threadkey.cpp \ |
| + friends.cpp event.cpp slog.cpp dir.cpp file.cpp inaddr.cpp \ |
| + peer.cpp timer.cpp socket.cpp strchar.cpp simplesocket.cpp \ |
| + mempager.cpp keydata.cpp dso.cpp exception.cpp missing.cpp \ |
| + process.cpp string.cpp in6addr.cpp buffer.cpp lockfile.cpp \ |
| + nat.cpp runlist.cpp assoc.cpp pointer.cpp linked.cpp map.cpp \ |
| + cidr.cpp |
| + |
| +#LOCAL_LDFLAGS := -version-info $(LT_VERSION) -release $(LT_RELEASE) $(SHARED_FLAGS) |
| + |
| +include $(BUILD_SHARED_LIBRARY) |
| + |
| diff -Naur src-orig/Application.mk src/Application.mk |
| --- src-orig/Application.mk 1969-12-31 19:00:00.000000000 -0500 |
| +++ src/Application.mk 2012-08-01 09:46:58.828316398 -0400 |
| @@ -0,0 +1,4 @@ |
| +APP_OPTIM := release |
| +APP_MODULES := libccgnu2 |
| +APP_STL := gnustl_static |
| +APP_CPPFLAGS= -std=gnu++0x |
| diff -Naur src-orig/friends.cpp src/friends.cpp |
| --- src-orig/friends.cpp 2010-10-31 19:41:27.000000000 -0400 |
| +++ src/friends.cpp 2012-07-31 13:51:26.334853592 -0400 |
| @@ -120,7 +120,7 @@ |
| Cancel old = Thread::enterCancel(); |
| |
| ts.tv_sec = timeout / 1000; |
| - ts.tv_usec = (timeout % 1000) * 1000000; |
| + ts.tv_nsec = (timeout % 1000) * 1000000000; |
| #ifdef HAVE_PTHREAD_DELAY |
| pthread_delay(&ts); |
| #else |
| diff -Naur src-orig/process.cpp src/process.cpp |
| --- src-orig/process.cpp 2010-10-31 20:04:11.000000000 -0400 |
| +++ src/process.cpp 2012-08-01 10:10:50.444265762 -0400 |
| @@ -336,7 +336,7 @@ |
| group = ::getgrnam(id); |
| #endif |
| if(!group) { |
| - endgrent(); |
| + /* endgrent(); */ |
| return false; |
| } |
| |
| @@ -344,11 +344,11 @@ |
| setegid(group->gr_gid); |
| #endif |
| if(setgid(group->gr_gid)) { |
| - endgrent(); |
| + /* endgrent(); */ |
| return false; |
| } |
| |
| - endgrent(); |
| + /* endgrent(); */ |
| return true; |
| } |
| |
| diff -Naur src-orig/thread.cpp src/thread.cpp |
| --- src-orig/thread.cpp 2010-10-31 20:58:07.000000000 -0400 |
| +++ src/thread.cpp 2012-07-31 15:19:02.930667664 -0400 |
| @@ -49,6 +49,7 @@ |
| #include <cstdlib> |
| #endif |
| #include "private.h" |
| +#include <asm/page.h> |
| |
| #ifdef CCXX_HAVE_NEW_INIT |
| #include <new> |
| @@ -186,8 +187,10 @@ |
| #ifdef WIN32 |
| Thread::yield(); |
| #else |
| +#ifndef ANDROID |
| pthread_testcancel(); |
| #endif |
| +#endif |
| } |
| |
| return old; |
| @@ -202,8 +205,10 @@ |
| |
| if(old != th->_cancel) { |
| #ifndef WIN32 |
| +#ifndef ANDROID |
| pthread_testcancel(); |
| #endif |
| +#endif |
| th->setCancel(old); |
| } |
| } |
| @@ -679,12 +684,14 @@ |
| #endif // ifdef _POSIX_THREAD_PRIORITY_SCHEDULING |
| #endif // ifndef __FreeBSD__ |
| |
| +#ifndef ANDROID |
| #ifdef __HAS_PRIORITY_SCHEDULING__ |
| if(!pri) |
| pthread_attr_setinheritsched(&priv->_attr, PTHREAD_INHERIT_SCHED); |
| #else |
| pthread_attr_setinheritsched(&priv->_attr, PTHREAD_INHERIT_SCHED); |
| #endif |
| +#endif |
| |
| _parent = getThread(); |
| priv->_throw = _parent->priv->_throw; |