Commit 3c55062f by Bernard Banner Committed by Arnaud Charlet

2012-11-06 Bernard Banner <banner@adacore.com>

	* adaint.c Add file macro definitions missing on Android.
	* adaint.h Avoid definitions related to task affinity and CPU
	sets since this functionality is missing on the Android
	* errno.c (__set_errno): Android already contains such a named
	procedure so do include again.
	* gsocket.h: Sockets not supported on Android.
	* init.c: Avoid linux related code not supported on Android.
	* sysdep.c (sigismember, sigaddset, sigdelset, sigemptyset,
	sigfillset): wrapper functions since sig routines are defined
	as inline macros on Android.
	* terminals.c: Add stubs for terminal related functions not
	supported on Android.

From-SVN: r193213
parent 055311dd
2012-11-06 Bernard Banner <banner@adacore.com>
* adaint.c Add file macro definitions missing on Android.
* adaint.h Avoid definitions related to task affinity and CPU
sets since this functionality is missing on the Android
* errno.c (__set_errno): Android already contains such a named
procedure so do include again.
* gsocket.h: Sockets not supported on Android.
* init.c: Avoid linux related code not supported on Android.
* sysdep.c (sigismember, sigaddset, sigdelset, sigemptyset,
sigfillset): wrapper functions since sig routines are defined
as inline macros on Android.
* terminals.c: Add stubs for terminal related functions not
supported on Android.
2012-11-06 Hristian Kirtchev <kirtchev@adacore.com> 2012-11-06 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Pragma): Do not * sem_prag.adb (Analyze_Pragma): Do not
......
...@@ -87,8 +87,8 @@ extern "C" { ...@@ -87,8 +87,8 @@ extern "C" {
#include <unixio.h> #include <unixio.h>
#endif #endif
#ifdef __vxworks #if defined (__vxworks) || defined (__ANDROID__)
/* S_IREAD and S_IWRITE are not defined in VxWorks */ /* S_IREAD and S_IWRITE are not defined in VxWorks or Android */
#ifndef S_IREAD #ifndef S_IREAD
#define S_IREAD (S_IRUSR | S_IRGRP | S_IROTH) #define S_IREAD (S_IRUSR | S_IRGRP | S_IROTH)
#endif #endif
...@@ -3763,7 +3763,16 @@ void __main (void) {} ...@@ -3763,7 +3763,16 @@ void __main (void) {}
#endif #endif
#endif #endif
#if defined (linux) #if defined (__ANDROID__)
#include <pthread.h>
void *__gnat_lwp_self (void)
{
return (void *) pthread_self ();
}
#elif defined (linux)
/* There is no function in the glibc to retrieve the LWP of the current /* There is no function in the glibc to retrieve the LWP of the current
thread. We need to do a system call in order to retrieve this thread. We need to do a system call in order to retrieve this
information. */ information. */
......
...@@ -250,7 +250,11 @@ extern char * __gnat_locate_executable_file (char *, char *); ...@@ -250,7 +250,11 @@ extern char * __gnat_locate_executable_file (char *, char *);
extern char * __gnat_locate_file_with_predicate (char *, char *, extern char * __gnat_locate_file_with_predicate (char *, char *,
int (*)(char*)); int (*)(char*));
#if defined (linux) #if defined (__ANDROID__)
#undef linux
extern void *__gnat_lwp_self (void);
#elif defined (linux)
extern void *__gnat_lwp_self (void); extern void *__gnat_lwp_self (void);
/* Routines for interface to required CPU set primitives */ /* Routines for interface to required CPU set primitives */
......
...@@ -58,8 +58,10 @@ __get_errno(void) ...@@ -58,8 +58,10 @@ __get_errno(void)
return errno; return errno;
} }
#ifndef __ANDROID__
void void
__set_errno(int err) __set_errno(int err)
{ {
errno = err; errno = err;
} }
#endif
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* * * *
****************************************************************************/ ****************************************************************************/
#if defined(__nucleus__) || defined(VTHREADS) #if defined(__nucleus__) || defined(VTHREADS) || defined(__ANDROID__)
#warning Sockets not supported on these platforms #warning Sockets not supported on these platforms
#undef HAVE_SOCKETS #undef HAVE_SOCKETS
......
...@@ -52,6 +52,10 @@ extern "C" { ...@@ -52,6 +52,10 @@ extern "C" {
#include "vxWorks.h" #include "vxWorks.h"
#endif #endif
#ifdef __ANDROID__
#undef linux
#endif
#ifdef IN_RTS #ifdef IN_RTS
#include "tconfig.h" #include "tconfig.h"
#include "tsystem.h" #include "tsystem.h"
......
...@@ -44,6 +44,10 @@ ...@@ -44,6 +44,10 @@
#include "vxWorks.h" #include "vxWorks.h"
#endif #endif
#ifdef __ANDROID__
#undef linux
#endif
#ifdef IN_RTS #ifdef IN_RTS
#define POSIX #define POSIX
#include "tconfig.h" #include "tconfig.h"
...@@ -923,3 +927,53 @@ __gnat_is_file_not_found_error (int errno_val) { ...@@ -923,3 +927,53 @@ __gnat_is_file_not_found_error (int errno_val) {
return 0; return 0;
} }
} }
#ifdef __ANDROID__
/* Provide extern symbols for sig* as needed by the tasking run-time, instead
of static inline functions. */
#define sigismember android_sigismember
#define sigaddset android_sigaddset
#define sigdelset android_sigdelset
#define sigemptyset android_sigemptyset
#define sigfillset android_sigfillset
#include <signal.h>
#undef sigismember
#undef sigaddset
#undef sigdelset
#undef sigemptyset
#undef sigfillset
int
sigismember (sigset_t *set, int signum)
{
return android_sigismember (set, signum);
}
int
sigaddset (sigset_t *set, int signum)
{
return android_sigaddset (set, signum);
}
int
sigdelset (sigset_t *set, int signum)
{
return android_sigdelset (set, signum);
}
int
sigemptyset (sigset_t *set)
{
return android_sigemptyset (set);
}
int
sigfillset(sigset_t *set)
{
return android_sigfillset (set);
}
#endif
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
/* First all usupported platforms. Add stubs for exported routines. */ /* First all usupported platforms. Add stubs for exported routines. */
#if defined (VMS) || defined (__vxworks) || defined (__Lynx__) #if defined (VMS) || defined (__vxworks) || defined (__Lynx__) || \
defined (__ANDROID__)
void * __gnat_new_tty (void) { return (void*)0; } void * __gnat_new_tty (void) { return (void*)0; }
char * __gnat_tty_name (void* t) { return (char*)0; } char * __gnat_tty_name (void* t) { return (char*)0; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment