PATCH: Define AES_SOURCE so Tru64 UNIX V4.0F <stdlib.h> declares unsetenv() for ada/env.c

Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Tue Oct 13 18:47:00 GMT 2009


I've just tried to bootstrap mainline on alpha-dec-osf4.0f after several
months and found that ada/env.c doesn't compile:

/vol/gcc/src/gcc-dist/gcc/ada/env.c: In function '__gnat_unsetenv':
/vol/gcc/src/gcc-dist/gcc/ada/env.c:274:3: error: implicit declaration of
function 'unsetenv'

On Tru64 UNIX V4.0F, the unsetenv() declaration is protected by AES_SOURCE
(should really be _AES_SOURCE as everywhere else in the system headers), so
this needs to be defined for the compilation to continue.

Bootstrap is still running, but the error is gone.

Ok for mainline?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2009-10-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* env.c [__alpha__ && __osf__] (AES_SOURCE): Define.

Index: gcc/ada/env.c
===================================================================
--- gcc/ada/env.c	(revision 152698)
+++ gcc/ada/env.c	(working copy)
@@ -29,8 +29,11 @@
  *                                                                          *
  ****************************************************************************/
 
-/* Tru64 UNIX <stdlib.h> declares unsetenv() only if _BSD.  */
+/* Tru64 UNIX V4.0F <stdlib.h> declares unsetenv() only if AES_SOURCE (which
+   is plain broken, this should be _AES_SOURCE instead as everywhere else;
+   Tru64 UNIX V5.1B declares it only if _BSD.  */
 #if defined (__alpha__) && defined (__osf__)
+#define AES_SOURCE
 #define _BSD
 #endif
 



More information about the Gcc-patches mailing list