Fix oldstyle_length regression test for netbsd-mac68k

Started by Rémi Zaraover 21 years ago3 messagespatches
Jump to latest
#1Rémi Zara
remi_zara@mac.com

Hi,

NetBSD mac68k's gcc does not define __mc68000__, but __m68k__
The following patch makes the oldstyle_length test pass on this platform
The change in miscinit is not necessary but for consistency sake (the
return value of the func is not read).

Index: src/backend/utils/fmgr/fmgr.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v
retrieving revision 1.86
diff -u -r1.86 fmgr.c
--- src/backend/utils/fmgr/fmgr.c       25 Oct 2004 00:46:42 -0000       
1.86
+++ src/backend/utils/fmgr/fmgr.c       25 Dec 2004 21:10:53 -0000
@@ -40,7 +40,7 @@
   * *additionally* into %d0 for compatibility.) The price is that there  
are
   * some warnings about int->pointer conversions...
   */
-#if defined(__mc68000__) && defined(__ELF__)
+#if (defined(__mc68000__) || (defined(__m68k__))) && defined(__ELF__)
  typedef int32 ((*func_ptr) ());
  #else
Index: src/backend/utils/init/miscinit.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/utils/init/miscinit.c,v
retrieving revision 1.135
diff -u -r1.135 miscinit.c
--- src/backend/utils/init/miscinit.c   9 Oct 2004 23:13:06 -0000        
1.135
+++ src/backend/utils/init/miscinit.c   25 Dec 2004 21:10:54 -0000
@@ -915,7 +915,7 @@

*-----------------------------------------------------------------------
--
*/

-#if defined(__mc68000__) && defined(__ELF__)
+#if (defined(__mc68000__) || (defined(__m68k__))) && defined(__ELF__)
  typedef int32 ((*func_ptr) ());

#else

Regards,

Rémi Zara

--
Rémi Zara
http://www.remi-zara.net/

Attachments:

smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Rémi Zara (#1)
Re: Fix oldstyle_length regression test for netbsd-mac68k

=?ISO-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:

NetBSD mac68k's gcc does not define __mc68000__, but __m68k__
The following patch makes the oldstyle_length test pass on this platform

Applied, thanks.

The change in miscinit is not necessary but for consistency sake

Actually I think that one should just declare the function as returning
void ...

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Rémi Zara (#1)
Re: Fix oldstyle_length regression test for netbsd-mac68k

Thanks. Tom has applied this fix.

---------------------------------------------------------------------------

R���mi Zara wrote:

Hi,

NetBSD mac68k's gcc does not define __mc68000__, but __m68k__
The following patch makes the oldstyle_length test pass on this platform
The change in miscinit is not necessary but for consistency sake (the
return value of the func is not read).

Index: src/backend/utils/fmgr/fmgr.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v
retrieving revision 1.86
diff -u -r1.86 fmgr.c
--- src/backend/utils/fmgr/fmgr.c       25 Oct 2004 00:46:42 -0000       
1.86
+++ src/backend/utils/fmgr/fmgr.c       25 Dec 2004 21:10:53 -0000
@@ -40,7 +40,7 @@
* *additionally* into %d0 for compatibility.) The price is that there  
are
* some warnings about int->pointer conversions...
*/
-#if defined(__mc68000__) && defined(__ELF__)
+#if (defined(__mc68000__) || (defined(__m68k__))) && defined(__ELF__)
typedef int32 ((*func_ptr) ());
#else
Index: src/backend/utils/init/miscinit.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/utils/init/miscinit.c,v
retrieving revision 1.135
diff -u -r1.135 miscinit.c
--- src/backend/utils/init/miscinit.c   9 Oct 2004 23:13:06 -0000        
1.135
+++ src/backend/utils/init/miscinit.c   25 Dec 2004 21:10:54 -0000
@@ -915,7 +915,7 @@

*-----------------------------------------------------------------------
--
*/

-#if defined(__mc68000__) && defined(__ELF__)
+#if (defined(__mc68000__) || (defined(__m68k__))) && defined(__ELF__)
typedef int32 ((*func_ptr) ());

#else

Regards,

R?mi Zara

--
R?mi Zara
http://www.remi-zara.net/

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073