factorial: Fix usage message to fit in with conventions.
[u/mdw/catacomb] / mptypes.c
index f10ed7e..613e214 100644 (file)
--- a/mptypes.c
+++ b/mptypes.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: mptypes.c,v 1.4 2000/10/08 12:05:24 mdw Exp $
+ * $Id$
  *
  * Generate `mptypes.h' header file for current architecture
  *
  * MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: mptypes.c,v $
- * Revision 1.4  2000/10/08 12:05:24  mdw
- * Make later versions of GCC shut up about @long long@.
- *
- * Revision 1.3  1999/12/10 23:29:48  mdw
- * Change header file guard names.
- *
- * Revision 1.2  1999/11/13 01:54:32  mdw
- * Format source code properly ;-).  Attach suffixes to the `max'
- * constants.
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #define _GNU_SOURCE
@@ -49,6 +34,7 @@
 #include <limits.h>
 #if __STDC_VERSION__ >= 199900l
 #  include <stdint.h>
+#  include <inttypes.h>
 #endif
 
 /*----- Data types --------------------------------------------------------*/
 
 /* --- Choose the largest integer type --- */
 
-#if defined(UINTMAX_MAX)
+#if defined(UINTMAX_MAX) && defined(PRIuMAX)
   typedef uintmax_t umax;
 # define P_UMAX PRIuMAX
 #elif defined(ULLONG_MAX)
-  __extension__ typedef unsigned long long umax;
-# define P_UMAX "%llu"
+  EXT typedef unsigned long long umax;
+# define P_UMAX "llu"
 #else
   typedef unsigned long umax;
-# define P_UMAX "%lu"
+# define P_UMAX "lu"
 #endif
 
 /* --- Table of interesting types --- *
@@ -190,11 +176,11 @@ int main(int argc, char *argv[])
   printf("\
 %stypedef %s mpw;\n\
 #define MPW_BITS %u\n\
-#define MPW_MAX %s" P_UMAX "%s\n\
+#define MPW_MAX %s%" P_UMAX "%s\n\
 \n\
 %stypedef %s mpd;\n\
 #define MPD_BITS %u\n\
-#define MPD_MAX %s" P_UMAX "%s\n\
+#define MPD_MAX %s%" P_UMAX "%s\n\
 \n\
 #endif\n\
 ",