changeset 8051:9c2b0396b27c

Stylistic change: Use '#if HAVE_*' instead of '#ifdef HAVE_*'.
author Bruno Haible <bruno@clisp.org>
date Tue, 30 Jan 2007 01:07:22 +0000
parents 6cec54d3ab2f
children f4e98fccacf0
files ChangeLog lib/allocsa.h lib/execute.c lib/pipe.c lib/printf-args.c lib/printf-args.h lib/printf-parse.c lib/vasnprintf.c
diffstat 8 files changed, 70 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-01-29  Bruno Haible  <bruno@clisp.org>
+
+	* lib/allocsa.h: Use '#if HAVE_*' instead of '#ifdef HAVE_*'.
+	* lib/execute.c: Likewise.
+	* lib/pipe.c: Likewise.
+	* lib/printf-args.h: Likewise.
+	* lib/printf-args.c: Likewise.
+	* lib/printf-parse.c: Likewise.
+	* lib/vasnprintf.c: Likewise.
+
 2007-01-29  Eric Blake  <ebb9@byu.net>
 
 	* lib/memrchr.c: Assume <string.h> unconditionally, to pull in
--- a/lib/allocsa.h
+++ b/lib/allocsa.h
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2006 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify
@@ -106,17 +106,17 @@
    among all elementary types.  */
   sa_alignment_long = sa_alignof (long),
   sa_alignment_double = sa_alignof (double),
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
   sa_alignment_longlong = sa_alignof (long long),
 #endif
-#ifdef HAVE_LONG_DOUBLE
+#if HAVE_LONG_DOUBLE
   sa_alignment_longdouble = sa_alignof (long double),
 #endif
   sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
 		      | (sa_alignment_longlong - 1)
 #endif
-#ifdef HAVE_LONG_DOUBLE
+#if HAVE_LONG_DOUBLE
 		      | (sa_alignment_longdouble - 1)
 #endif
 		     ) + 1,
--- a/lib/execute.c
+++ b/lib/execute.c
@@ -1,5 +1,5 @@
 /* Creation of autonomous subprocesses.
-   Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -46,17 +46,17 @@
 #else
 
 /* Unix API.  */
-# ifdef HAVE_POSIX_SPAWN
+# if HAVE_POSIX_SPAWN
 #  include <spawn.h>
 # else
-#  ifdef HAVE_VFORK_H
+#  if HAVE_VFORK_H
 #   include <vfork.h>
 #  endif
 # endif
 
 #endif
 
-#ifndef HAVE_ENVIRON_DECL
+#if ! HAVE_ENVIRON_DECL
 extern char **environ;
 #endif
 
--- a/lib/pipe.c
+++ b/lib/pipe.c
@@ -1,5 +1,5 @@
 /* Creation of subprocesses, communicating via pipes.
-   Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -45,17 +45,17 @@
 #else
 
 /* Unix API.  */
-# ifdef HAVE_POSIX_SPAWN
+# if HAVE_POSIX_SPAWN
 #  include <spawn.h>
 # else
-#  ifdef HAVE_VFORK_H
+#  if HAVE_VFORK_H
 #   include <vfork.h>
 #  endif
 # endif
 
 #endif
 
-#ifndef HAVE_ENVIRON_DECL
+#if ! HAVE_ENVIRON_DECL
 extern char **environ;
 #endif
 
--- a/lib/printf-args.c
+++ b/lib/printf-args.c
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -56,7 +56,7 @@
       case TYPE_ULONGINT:
 	ap->a.a_ulongint = va_arg (args, unsigned long int);
 	break;
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
       case TYPE_LONGLONGINT:
 	ap->a.a_longlongint = va_arg (args, long long int);
 	break;
@@ -67,7 +67,7 @@
       case TYPE_DOUBLE:
 	ap->a.a_double = va_arg (args, double);
 	break;
-#ifdef HAVE_LONG_DOUBLE
+#if HAVE_LONG_DOUBLE
       case TYPE_LONGDOUBLE:
 	ap->a.a_longdouble = va_arg (args, long double);
 	break;
@@ -75,7 +75,7 @@
       case TYPE_CHAR:
 	ap->a.a_char = va_arg (args, int);
 	break;
-#ifdef HAVE_WINT_T
+#if HAVE_WINT_T
       case TYPE_WIDE_CHAR:
 	/* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
 	   default argument promotions", this is not the case in mingw32,
@@ -94,7 +94,7 @@
 	if (ap->a.a_string == NULL)
 	  ap->a.a_string = "(NULL)";
 	break;
-#ifdef HAVE_WCHAR_T
+#if HAVE_WCHAR_T
       case TYPE_WIDE_STRING:
 	ap->a.a_wide_string = va_arg (args, const wchar_t *);
 	/* A null pointer is an invalid argument for "%ls", but in practice
@@ -128,7 +128,7 @@
       case TYPE_COUNT_LONGINT_POINTER:
 	ap->a.a_count_longint_pointer = va_arg (args, long int *);
 	break;
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
       case TYPE_COUNT_LONGLONGINT_POINTER:
 	ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
 	break;
--- a/lib/printf-args.h
+++ b/lib/printf-args.h
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,12 +22,12 @@
 #include <stddef.h>
 
 /* Get wchar_t.  */
-#ifdef HAVE_WCHAR_T
+#if HAVE_WCHAR_T
 # include <stddef.h>
 #endif
 
 /* Get wint_t.  */
-#ifdef HAVE_WINT_T
+#if HAVE_WINT_T
 # include <wchar.h>
 #endif
 
@@ -47,20 +47,20 @@
   TYPE_UINT,
   TYPE_LONGINT,
   TYPE_ULONGINT,
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
   TYPE_LONGLONGINT,
   TYPE_ULONGLONGINT,
 #endif
   TYPE_DOUBLE,
-#ifdef HAVE_LONG_DOUBLE
+#if HAVE_LONG_DOUBLE
   TYPE_LONGDOUBLE,
 #endif
   TYPE_CHAR,
-#ifdef HAVE_WINT_T
+#if HAVE_WINT_T
   TYPE_WIDE_CHAR,
 #endif
   TYPE_STRING,
-#ifdef HAVE_WCHAR_T
+#if HAVE_WCHAR_T
   TYPE_WIDE_STRING,
 #endif
   TYPE_POINTER,
@@ -68,7 +68,7 @@
   TYPE_COUNT_SHORT_POINTER,
   TYPE_COUNT_INT_POINTER,
   TYPE_COUNT_LONGINT_POINTER
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
 , TYPE_COUNT_LONGLONGINT_POINTER
 #endif
 } arg_type;
@@ -87,21 +87,21 @@
     unsigned int		a_uint;
     long int			a_longint;
     unsigned long int		a_ulongint;
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
     long long int		a_longlongint;
     unsigned long long int	a_ulonglongint;
 #endif
     float			a_float;
     double			a_double;
-#ifdef HAVE_LONG_DOUBLE
+#if HAVE_LONG_DOUBLE
     long double			a_longdouble;
 #endif
     int				a_char;
-#ifdef HAVE_WINT_T
+#if HAVE_WINT_T
     wint_t			a_wide_char;
 #endif
     const char*			a_string;
-#ifdef HAVE_WCHAR_T
+#if HAVE_WCHAR_T
     const wchar_t*		a_wide_string;
 #endif
     void*			a_pointer;
@@ -109,7 +109,7 @@
     short *			a_count_short_pointer;
     int *			a_count_int_pointer;
     long int *			a_count_longint_pointer;
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
     long long int *		a_count_longlongint_pointer;
 #endif
   }
--- a/lib/printf-parse.c
+++ b/lib/printf-parse.c
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -326,7 +326,7 @@
 		      flags += 8;
 		      cp++;
 		    }
-#ifdef HAVE_INTMAX_T
+#if HAVE_INTMAX_T
 		  else if (*cp == 'j')
 		    {
 		      if (sizeof (intmax_t) > sizeof (long))
@@ -382,7 +382,7 @@
 	      switch (c)
 		{
 		case 'd': case 'i':
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
 		  /* If 'long long' exists and is larger than 'long':  */
 		  if (flags >= 16 || (flags & 4))
 		    type = TYPE_LONGLONGINT;
@@ -400,7 +400,7 @@
 		    type = TYPE_INT;
 		  break;
 		case 'o': case 'u': case 'x': case 'X':
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
 		  /* If 'long long' exists and is larger than 'long':  */
 		  if (flags >= 16 || (flags & 4))
 		    type = TYPE_ULONGLONGINT;
@@ -419,7 +419,7 @@
 		  break;
 		case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
 		case 'a': case 'A':
-#ifdef HAVE_LONG_DOUBLE
+#if HAVE_LONG_DOUBLE
 		  if (flags >= 16 || (flags & 4))
 		    type = TYPE_LONGDOUBLE;
 		  else
@@ -428,7 +428,7 @@
 		  break;
 		case 'c':
 		  if (flags >= 8)
-#ifdef HAVE_WINT_T
+#if HAVE_WINT_T
 		    type = TYPE_WIDE_CHAR;
 #else
 		    goto error;
@@ -436,7 +436,7 @@
 		  else
 		    type = TYPE_CHAR;
 		  break;
-#ifdef HAVE_WINT_T
+#if HAVE_WINT_T
 		case 'C':
 		  type = TYPE_WIDE_CHAR;
 		  c = 'c';
@@ -444,7 +444,7 @@
 #endif
 		case 's':
 		  if (flags >= 8)
-#ifdef HAVE_WCHAR_T
+#if HAVE_WCHAR_T
 		    type = TYPE_WIDE_STRING;
 #else
 		    goto error;
@@ -452,7 +452,7 @@
 		  else
 		    type = TYPE_STRING;
 		  break;
-#ifdef HAVE_WCHAR_T
+#if HAVE_WCHAR_T
 		case 'S':
 		  type = TYPE_WIDE_STRING;
 		  c = 's';
@@ -462,7 +462,7 @@
 		  type = TYPE_POINTER;
 		  break;
 		case 'n':
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
 		  /* If 'long long' exists and is larger than 'long':  */
 		  if (flags >= 16 || (flags & 4))
 		    type = TYPE_COUNT_LONGLONGINT_POINTER;
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -49,8 +49,8 @@
 /* Checked size_t computations.  */
 #include "xsize.h"
 
-#ifdef HAVE_WCHAR_T
-# ifdef HAVE_WCSLEN
+#if HAVE_WCHAR_T
+# if HAVE_WCSLEN
 #  define local_wcslen wcslen
 # else
    /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
@@ -248,7 +248,7 @@
 		  case TYPE_COUNT_LONGINT_POINTER:
 		    *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
 		    break;
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
 		  case TYPE_COUNT_LONGLONGINT_POINTER:
 		    *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
 		    break;
@@ -322,7 +322,7 @@
 		    {
 
 		    case 'd': case 'i': case 'u':
-# ifdef HAVE_LONG_LONG_INT
+# if HAVE_LONG_LONG_INT
 		      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
 			tmp_length =
 			  (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
@@ -352,7 +352,7 @@
 		      break;
 
 		    case 'o':
-# ifdef HAVE_LONG_LONG_INT
+# if HAVE_LONG_LONG_INT
 		      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
 			tmp_length =
 			  (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
@@ -380,7 +380,7 @@
 		      break;
 
 		    case 'x': case 'X':
-# ifdef HAVE_LONG_LONG_INT
+# if HAVE_LONG_LONG_INT
 		      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
 			tmp_length =
 			  (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
@@ -408,7 +408,7 @@
 		      break;
 
 		    case 'f': case 'F':
-# ifdef HAVE_LONG_DOUBLE
+# if HAVE_LONG_DOUBLE
 		      if (type == TYPE_LONGDOUBLE)
 			tmp_length =
 			  (unsigned int) (LDBL_MAX_EXP
@@ -437,7 +437,7 @@
 		      break;
 
 		    case 'c':
-# if defined HAVE_WINT_T && !WIDE_CHAR_VERSION
+# if HAVE_WINT_T && !WIDE_CHAR_VERSION
 		      if (type == TYPE_WIDE_CHAR)
 			tmp_length = MB_CUR_MAX;
 		      else
@@ -446,7 +446,7 @@
 		      break;
 
 		    case 's':
-# ifdef HAVE_WCHAR_T
+# if HAVE_WCHAR_T
 		      if (type == TYPE_WIDE_STRING)
 			{
 			  tmp_length =
@@ -527,7 +527,7 @@
 
 		switch (type)
 		  {
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
 		  case TYPE_LONGLONGINT:
 		  case TYPE_ULONGLONGINT:
 		    *p++ = 'l';
@@ -535,15 +535,15 @@
 #endif
 		  case TYPE_LONGINT:
 		  case TYPE_ULONGINT:
-#ifdef HAVE_WINT_T
+#if HAVE_WINT_T
 		  case TYPE_WIDE_CHAR:
 #endif
-#ifdef HAVE_WCHAR_T
+#if HAVE_WCHAR_T
 		  case TYPE_WIDE_STRING:
 #endif
 		    *p++ = 'l';
 		    break;
-#ifdef HAVE_LONG_DOUBLE
+#if HAVE_LONG_DOUBLE
 		  case TYPE_LONGDOUBLE:
 		    *p++ = 'L';
 		    break;
@@ -681,7 +681,7 @@
 			  SNPRINTF_BUF (arg);
 			}
 			break;
-#ifdef HAVE_LONG_LONG_INT
+#if HAVE_LONG_LONG_INT
 		      case TYPE_LONGLONGINT:
 			{
 			  long long int arg = a.arg[dp->arg_index].a.a_longlongint;
@@ -701,7 +701,7 @@
 			  SNPRINTF_BUF (arg);
 			}
 			break;
-#ifdef HAVE_LONG_DOUBLE
+#if HAVE_LONG_DOUBLE
 		      case TYPE_LONGDOUBLE:
 			{
 			  long double arg = a.arg[dp->arg_index].a.a_longdouble;
@@ -715,7 +715,7 @@
 			  SNPRINTF_BUF (arg);
 			}
 			break;
-#ifdef HAVE_WINT_T
+#if HAVE_WINT_T
 		      case TYPE_WIDE_CHAR:
 			{
 			  wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
@@ -729,7 +729,7 @@
 			  SNPRINTF_BUF (arg);
 			}
 			break;
-#ifdef HAVE_WCHAR_T
+#if HAVE_WCHAR_T
 		      case TYPE_WIDE_STRING:
 			{
 			  const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;