This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

darwin-fallback.c type cleanness


This uses what is (apparently) the preferred type, and thereby fixes
what will be a build failure on the next version of Darwin.

This is not technically a regression.  If I applied a strict
interpretation of Mark's commit rules, I couldn't commit it.  However,
that would lead to the absurd result that gcc 4.0 would not build on
new versions of Darwin.  I am going to assume that what Mark meant is
"please don't fix bugs that existed in previous versions of the
compiler".

Bootstrapped & tested on powerpc-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-fallbackucontext.patch================
2005-01-03  Geoffrey Keating  <geoffk@apple.com>

	* config/rs6000/darwin-fallback.c: Use 'ucontext_t' rather than
	'struct ucontext'.

Index: config/rs6000/darwin-fallback.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin-fallback.c,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 darwin-fallback.c
--- config/rs6000/darwin-fallback.c	29 Oct 2004 22:45:50 -0000	1.2
+++ config/rs6000/darwin-fallback.c	3 Jan 2005 23:16:45 -0000
@@ -278,7 +278,7 @@ static bool
 handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32],
 		_Unwind_Ptr old_cfa)
 {
-  struct ucontext *uctx;
+  ucontext_t *uctx;
   bool is_64, is_vector;
   ppc_float_state_t *float_state;
   ppc_vector_state_t *vector_state;
@@ -293,7 +293,7 @@ handle_syscall (_Unwind_FrameState *fs, 
   
   if (gprs[0] == 0x67 /* SYS_SIGRETURN */)
     {
-      uctx = (struct ucontext *) gprs[3];
+      uctx = (ucontext_t *) gprs[3];
       is_vector = (uctx->uc_mcsize == UC_FLAVOR64_VEC_SIZE
 		   || uctx->uc_mcsize == UC_FLAVOR_VEC_SIZE);
       is_64 = (uctx->uc_mcsize == UC_FLAVOR64_VEC_SIZE
@@ -302,7 +302,7 @@ handle_syscall (_Unwind_FrameState *fs, 
   else if (gprs[0] == 0 && gprs[3] == 184)
     {
       int ctxstyle = gprs[5];
-      uctx = (struct ucontext *) gprs[4];
+      uctx = (ucontext_t *) gprs[4];
       is_vector = (ctxstyle == UC_FLAVOR_VEC || ctxstyle == UC_FLAVOR64_VEC
 		   || ctxstyle == UC_TRAD_VEC || ctxstyle == UC_TRAD64_VEC);
       is_64 = (ctxstyle == UC_FLAVOR64_VEC || ctxstyle == UC_TRAD64_VEC
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]