diff options
author | Patrick Bernardi <bernardi@adacore.com> | 2020-07-28 11:36:08 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-10-21 03:22:44 -0400 |
commit | 512fe5e067c8e0de195fe891bcdcc844da1eb7dd (patch) | |
tree | 0032953da33d41ec3222b4611464d448ed5acebe /gcc/ada/env.c | |
parent | 54c49fcdd7064b20b557f1027ae03c9eac2b07d4 (diff) | |
download | gcc-512fe5e067c8e0de195fe891bcdcc844da1eb7dd.zip gcc-512fe5e067c8e0de195fe891bcdcc844da1eb7dd.tar.gz gcc-512fe5e067c8e0de195fe891bcdcc844da1eb7dd.tar.bz2 |
[Ada] Simplify the VxWorks implementation of __gnat_environ
gcc/ada/
* env.c (__gnat_environ): For VxWorks kernel simply return the
result of the envGet call. Do this for VxWorks 6 and 7 as they
both support the same API.
Diffstat (limited to 'gcc/ada/env.c')
-rw-r--r-- | gcc/ada/env.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/gcc/ada/env.c b/gcc/ada/env.c index 5df0539..287260d 100644 --- a/gcc/ada/env.c +++ b/gcc/ada/env.c @@ -68,18 +68,9 @@ envLib.h on VxWorks MILS and VxWorks 653. */ #include <vThreadsData.h> #include <envLib.h> - #elif (_WRS_VXWORKS_MAJOR <= 6) + #else + /* Kernel mode */ #include <envLib.h> - /* In that mode the following symbol is not defined in any VxWorks - include files, prior to vxWorks 7, so we declare it as extern. */ - extern char** ppGlobalEnviron; - #elif (_WRS_VXWORKS_MAJOR >= 7) - /* This should work for kernel mode on VxWorks 7.x. In 7.2 the tcb - is made private, so accessor functions must be used, in 7.0 it - is optional but there is no way to distinguish between 7.2 - and 7.0 since the version.h header file was never updated. */ - #include <envLib.h> - #include <taskLibCommon.h> #endif #endif @@ -144,17 +135,11 @@ __gnat_environ (void) extern char **environ; return environ; #else - #if defined (__RTP__) || defined (VTHREADS) || (_WRS_VXWORKS_MAJOR <= 6) + #if defined (__RTP__) || defined (VTHREADS) return environ; - #elif (_WRS_VXWORKS_MAJOR >= 7) - char **task_environ; - - task_environ = envGet (taskIdSelf ()); - - if (task_environ == NULL) - return ppGlobalEnviron; - else - return task_environ; + #else + /* Kernel mode */ + return envGet (NULL); #endif #endif } |