re PR libfortran/30690 ([4.2, 4.1 only] Clean up m4 files)
[gcc.git] / libgfortran / m4 / shape.m4
index 5481ba07cb6acb9e2e59c7c0c2ca5a2751d6fe52..1902d7514d61b3f7bbad3bb1807f519b7656671a 100644 (file)
@@ -1,5 +1,5 @@
 `/* Implementation of the SHAPE intrinsic
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2006 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -34,18 +34,20 @@ Boston, MA 02110-1301, USA.  */
 #include "libgfortran.h"'
 include(iparm.m4)dnl
 
-extern void shape_`'rtype_kind (rtype * ret, const rtype * array);
-export_proto(shape_`'rtype_kind);
+`#if defined (HAVE_'rtype_name`)
+
+extern void shape_'rtype_kind` ('rtype` * const restrict ret, 
+       const 'rtype` * const restrict array);
+export_proto(shape_'rtype_kind`);
 
 void
-shape_`'rtype_kind (rtype * ret, const rtype * array)
+shape_'rtype_kind` ('rtype` * const restrict ret, 
+       const 'rtype` * const restrict array)
 {
   int n;
   index_type stride;
 
   stride = ret->dim[0].stride;
-  if (stride == 0)
-    stride = 1;
 
   for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++)
     {
@@ -53,3 +55,5 @@ shape_`'rtype_kind (rtype * ret, const rtype * array)
         array->dim[n].ubound + 1 - array->dim[n].lbound;
     }
 }
+
+#endif'