summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2011-07-19 20:17:09 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2011-07-19 20:17:09 +0000
commit80012f8bf8032f0c28e4e5ca02d4672370a25137 (patch)
treeea06d543ffc8e066ccfbaf96a8be8a7ca0e6461a
parent10d279d3172a275f5f53fb18d4a0945f589a7224 (diff)
downloadATCD-saic_android.tar.gz
Tue Jul 19 20:15:51 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu>saic_android
* ace/config-android.h: * examples/APG/ThreadManagement/Async_Cancel.cpp: * examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp: * examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl: * examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl: * examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp: * examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp: * include/makeinclude/platform_android.GNU: * tests/Logging_Strategy_Test.cpp: * tests/Thread_Attrs_Test.cpp: Various android fixes.
-rw-r--r--ACE/ChangeLog15
-rw-r--r--ACE/ace/config-android.h6
-rw-r--r--ACE/examples/APG/ThreadManagement/Async_Cancel.cpp8
-rw-r--r--ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp6
-rw-r--r--ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl4
-rw-r--r--ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl4
-rw-r--r--ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp4
-rw-r--r--ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp5
-rw-r--r--ACE/include/makeinclude/platform_android.GNU7
-rw-r--r--ACE/tests/Logging_Strategy_Test.cpp4
-rw-r--r--ACE/tests/Thread_Attrs_Test.cpp2
11 files changed, 60 insertions, 5 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 2e433750354..68b1078f492 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,18 @@
+Tue Jul 19 20:15:51 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu>
+
+ * ace/config-android.h:
+ * examples/APG/ThreadManagement/Async_Cancel.cpp:
+ * examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp:
+ * examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl:
+ * examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl:
+ * examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp:
+ * examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp:
+ * include/makeinclude/platform_android.GNU:
+ * tests/Logging_Strategy_Test.cpp:
+ * tests/Thread_Attrs_Test.cpp:
+
+ Various android fixes.
+
Tue Jul 19 18:22:23 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu>
* ace/config-android.h:
diff --git a/ACE/ace/config-android.h b/ACE/ace/config-android.h
index c17f1f36807..dc33dd47522 100644
--- a/ACE/ace/config-android.h
+++ b/ACE/ace/config-android.h
@@ -31,6 +31,9 @@
#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
#define ACE_HAS_LINUX_SEM_H
#define ACE_HAS_LINUX_SHM_H
+#define ACE_LACKS_CUSERID
+#define ACE_LACKS_GETHOSTENT
+
// I'm not sure if this is correct
#define ACE_LACKS_RWLOCK_T
@@ -62,8 +65,6 @@ typedef unsigned long fd_mask;
#undef ACE_SCANDIR_CMP_USES_VOIDPTR
#endif
-#define ACE_LACKS_CUSERID
-
#ifdef ACE_SCANDIR_CMP_USES_CONST_VOIDPTR
#undef ACE_SCANDIR_CMP_USES_CONST_VOIDPTR
#endif
@@ -88,7 +89,6 @@ typedef unsigned long fd_mask;
#undef ACE_HAS_LINUX_SYSINFO
#endif
-#define ACE_LACKS_CUSERID
#define ACE_LACKS_PWD_FUNCTIONS
#define ACE_ERRNO_TYPE volatile int
diff --git a/ACE/examples/APG/ThreadManagement/Async_Cancel.cpp b/ACE/examples/APG/ThreadManagement/Async_Cancel.cpp
index 842c7fa2bca..673a32eccac 100644
--- a/ACE/examples/APG/ThreadManagement/Async_Cancel.cpp
+++ b/ACE/examples/APG/ThreadManagement/Async_Cancel.cpp
@@ -29,6 +29,7 @@ public:
{
cancel_state new_state;
+#ifndef ACE_LACKS_PTHREAD_CANCEL
// Set the cancel state to asynchronous and enabled.
new_state.cancelstate = PTHREAD_CANCEL_ENABLE;
new_state.canceltype = PTHREAD_CANCEL_ASYNCHRONOUS;
@@ -37,6 +38,13 @@ public:
ACE_TEXT ("%p\n"),
ACE_TEXT ("cancelstate")), -1);
return 0;
+
+#else
+
+ ACE_ERROR ((LM_ERROR, "Pthread_cancel is not supported on this platform.\n"));
+ return -1;
+
+#endif
}
};
// Listing 1
diff --git a/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp b/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp
index c4b3944b26f..fe572822c3c 100644
--- a/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp
+++ b/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp
@@ -92,7 +92,13 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
-1);
char name[ACE_MAX_USERID];
+
+#ifndef ACE_LACKS_CUSERID
ACE_OS::cuserid (name);
+#else
+ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Error: ::cuserid is not supported on this platform\n")),
+ -1);
+#endif
if (sd.send (name,
ACE_OS::strlen (name) + 1,
diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl
index 03b87ef905c..b82dadd9278 100644
--- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl
+++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl
@@ -15,8 +15,12 @@ Handle_L_Stream::~Handle_L_Stream (void)
ACE_INLINE
Handle_L_Stream::Handle_L_Stream (void)
{
+#ifndef ACE_LACKS_CUSERID
if (Handle_L_Stream::login_name == 0)
Handle_L_Stream::login_name = ACE_OS::cuserid (Handle_L_Stream::login);
+#else
+ ACE_ERROR ((LM_ERROR, "Error: cuserid is not supported on this platform"));
+#endif
}
ACE_INLINE int
diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl
index 2a9d9f84fdd..5509dbdcb0a 100644
--- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl
+++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.inl
@@ -12,8 +12,12 @@
ACE_INLINE
Handle_R_Stream::Handle_R_Stream (void)
{
+#ifndef ACE_LACKS_CUSERID
if (Handle_R_Stream::login_name == 0)
Handle_R_Stream::login_name = ACE_OS::cuserid (Handle_R_Stream::login);
+#else
+ ACE_ERROR ((LM_ERROR, "Error: cuserid is not supported on this platform"));
+#endif
}
ACE_INLINE int
diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp
index f5b952ca7a1..d51ac01f923 100644
--- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp
+++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp
@@ -158,7 +158,11 @@ CLI_Stream<PR_ST_2>::svc (void)
ACE_OS::fflush (stdout);
time_t t = ACE_OS::time (0L);
+#ifndef ACE_LACKS_CUSERID
ACE_OS::cuserid (login_name);
+#else
+ ACE_ERROR ((LM_ERROR, "Error: cuserid is not supported on this platform"));
+#endif
ACE_OS::sprintf (buf,
"user %s %s",
login_name,
diff --git a/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp b/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp
index d2bcf36cc9e..5fb5b98c492 100644
--- a/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp
+++ b/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp
@@ -19,9 +19,14 @@ ACE_TMAIN (int, ACE_TCHAR *[])
ACE_Typed_SV_Message_Queue<Message_Data> msgque (key_t (SRV_KEY));
+#ifndef ACE_LACKS_CUSERID
Message_Data msg_data (pid,
ACE_OS::cuserid (static_cast<char *> (0)),
"did you get this?");
+#else
+ Message_Data msg_data;
+ ACE_ERROR ((LM_ERROR, "Error: platform lacks cuserid\n"));
+#endif
ACE_Typed_SV_Message<Message_Data> send_msg (msg_data,
SRV_ID,
diff --git a/ACE/include/makeinclude/platform_android.GNU b/ACE/include/makeinclude/platform_android.GNU
index c20bbfffc12..d6068a89fdc 100644
--- a/ACE/include/makeinclude/platform_android.GNU
+++ b/ACE/include/makeinclude/platform_android.GNU
@@ -3,12 +3,19 @@ static_libs_only=1
ssl=0
inline=0
+# We don't have rwho.
+rwho = 0
+
# HOST_PREBUILT :=/Users/frohnhoefere/Android/android-toolchain
NDK_HOME := /opt/android-ndk-r6
ANDROID_ARCH ?= arm
ANDROID_PLATFORM ?= android-8
SYSROOT := $(NDK_HOME)/platforms/$(ANDROID_PLATFORM)/arch-$(ANDROID_ARCH)
+ifeq ($(ANDROID_ARCH), arm)
+ CROSS-COMPILE=1
+endif
+
CC_FLAGS += $(CFLAGS) $(TEMPLATES_FLAG)
CPP_FLAGS += \
diff --git a/ACE/tests/Logging_Strategy_Test.cpp b/ACE/tests/Logging_Strategy_Test.cpp
index 6b3c6a8394d..bf990348c0d 100644
--- a/ACE/tests/Logging_Strategy_Test.cpp
+++ b/ACE/tests/Logging_Strategy_Test.cpp
@@ -212,9 +212,11 @@ get_statistics (ACE_TCHAR *f_name)
ACE_TEXT (" File size (B): %d\n"),
buf.st_size));
+ time_t time = static_cast <time_t> (buf.st_mtime);
+
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT (" Time modified : %s\n"),
- ACE_OS::ctime (&buf.st_mtime)));
+ ACE_OS::ctime (&time)));
}
return buf.st_mtime;
diff --git a/ACE/tests/Thread_Attrs_Test.cpp b/ACE/tests/Thread_Attrs_Test.cpp
index 270401efdc7..7a9c8351b79 100644
--- a/ACE/tests/Thread_Attrs_Test.cpp
+++ b/ACE/tests/Thread_Attrs_Test.cpp
@@ -64,7 +64,7 @@ Cancel_Check::Cancel_Check (bool enable, bool async)
int
Cancel_Check::svc (void)
{
-#if defined (ACE_HAS_PTHREADS)
+#if defined (ACE_HAS_PTHREADS) && !defined (ACE_LACKS_PTHREAD_CANCEL)
int state;
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &state);
if (state == PTHREAD_CANCEL_ENABLE && !this->enable_req_)