blob: 998797576974bc84d3bd4752056d16ecc09df406 [file] [log] [blame]
Emeric Vigier2f625822012-08-06 11:09:52 -04001diff -Naur src-orig/Android.mk src/Android.mk
2--- src-orig/Android.mk 1969-12-31 19:00:00.000000000 -0500
3+++ src/Android.mk 2012-08-01 09:45:59.240318503 -0400
4@@ -0,0 +1,25 @@
5+LOCAL_PATH := $(call my-dir)
6+include $(CLEAR_VARS)
7+
8+LT_VERSION = "0:1"
9+LT_RELEASE = "1.8"
10+SHARED_FLAGS = "-no-undefined"
11+
12+LOCAL_CPPFLAGS += -Wno-psabi -frtti -pthread -fexceptions
13+LOCAL_MODULE := libccgnu2
14+LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib
15+
16+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../inc
17+
18+LOCAL_SRC_FILES := thread.cpp mutex.cpp semaphore.cpp threadkey.cpp \
19+ friends.cpp event.cpp slog.cpp dir.cpp file.cpp inaddr.cpp \
20+ peer.cpp timer.cpp socket.cpp strchar.cpp simplesocket.cpp \
21+ mempager.cpp keydata.cpp dso.cpp exception.cpp missing.cpp \
22+ process.cpp string.cpp in6addr.cpp buffer.cpp lockfile.cpp \
23+ nat.cpp runlist.cpp assoc.cpp pointer.cpp linked.cpp map.cpp \
24+ cidr.cpp
25+
26+#LOCAL_LDFLAGS := -version-info $(LT_VERSION) -release $(LT_RELEASE) $(SHARED_FLAGS)
27+
28+include $(BUILD_SHARED_LIBRARY)
29+
30diff -Naur src-orig/Application.mk src/Application.mk
31--- src-orig/Application.mk 1969-12-31 19:00:00.000000000 -0500
32+++ src/Application.mk 2012-08-01 09:46:58.828316398 -0400
33@@ -0,0 +1,4 @@
34+APP_OPTIM := release
35+APP_MODULES := libccgnu2
36+APP_STL := gnustl_static
37+APP_CPPFLAGS= -std=gnu++0x
38diff -Naur src-orig/friends.cpp src/friends.cpp
39--- src-orig/friends.cpp 2010-10-31 19:41:27.000000000 -0400
40+++ src/friends.cpp 2012-07-31 13:51:26.334853592 -0400
41@@ -120,7 +120,7 @@
42 Cancel old = Thread::enterCancel();
43
44 ts.tv_sec = timeout / 1000;
45- ts.tv_usec = (timeout % 1000) * 1000000;
46+ ts.tv_nsec = (timeout % 1000) * 1000000000;
47 #ifdef HAVE_PTHREAD_DELAY
48 pthread_delay(&ts);
49 #else
50diff -Naur src-orig/process.cpp src/process.cpp
51--- src-orig/process.cpp 2010-10-31 20:04:11.000000000 -0400
52+++ src/process.cpp 2012-08-01 10:10:50.444265762 -0400
53@@ -336,7 +336,7 @@
54 group = ::getgrnam(id);
55 #endif
56 if(!group) {
57- endgrent();
58+ /* endgrent(); */
59 return false;
60 }
61
62@@ -344,11 +344,11 @@
63 setegid(group->gr_gid);
64 #endif
65 if(setgid(group->gr_gid)) {
66- endgrent();
67+ /* endgrent(); */
68 return false;
69 }
70
71- endgrent();
72+ /* endgrent(); */
73 return true;
74 }
75
76diff -Naur src-orig/thread.cpp src/thread.cpp
77--- src-orig/thread.cpp 2010-10-31 20:58:07.000000000 -0400
78+++ src/thread.cpp 2012-07-31 15:19:02.930667664 -0400
79@@ -49,6 +49,7 @@
80 #include <cstdlib>
81 #endif
82 #include "private.h"
83+#include <asm/page.h>
84
85 #ifdef CCXX_HAVE_NEW_INIT
86 #include <new>
87@@ -186,8 +187,10 @@
88 #ifdef WIN32
89 Thread::yield();
90 #else
91+#ifndef ANDROID
92 pthread_testcancel();
93 #endif
94+#endif
95 }
96
97 return old;
98@@ -202,8 +205,10 @@
99
100 if(old != th->_cancel) {
101 #ifndef WIN32
102+#ifndef ANDROID
103 pthread_testcancel();
104 #endif
105+#endif
106 th->setCancel(old);
107 }
108 }
109@@ -679,12 +684,14 @@
110 #endif // ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
111 #endif // ifndef __FreeBSD__
112
113+#ifndef ANDROID
114 #ifdef __HAS_PRIORITY_SCHEDULING__
115 if(!pri)
116 pthread_attr_setinheritsched(&priv->_attr, PTHREAD_INHERIT_SCHED);
117 #else
118 pthread_attr_setinheritsched(&priv->_attr, PTHREAD_INHERIT_SCHED);
119 #endif
120+#endif
121
122 _parent = getThread();
123 priv->_throw = _parent->priv->_throw;