]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Move away from redefining __attribute__ (Issue #5349)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 7 Nov 2018 19:06:29 +0000 (14:06 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 7 Nov 2018 19:06:29 +0000 (14:06 -0500)
37 files changed:
backend/dnssd.c
backend/testbackend.c
backend/usb-darwin.c
berkeley/lpq.c
cgi-bin/help-index.c
configure
cups/debug-private.h
cups/debug.c
cups/file.h
cups/http.h
cups/ipp.c
cups/language-private.h
cups/raster-private.h
cups/string-private.h
cups/testdest.c
cups/testsnmp.c
cups/versioning.h
filter/pstops.c
scheduler/conf.h
scheduler/cups-exec.c
scheduler/cupsd.h
scheduler/cupsfilter.c
scheduler/ipp.c
scheduler/job.h
scheduler/main.c
scheduler/mime-private.h
scheduler/testlpd.c
scheduler/testspeed.c
scheduler/testsub.c
systemv/cupsaddsmb.c
systemv/cupsctl.c
systemv/cupstestdsc.c
systemv/cupstestppd.c
systemv/lpoptions.c
test/ippfind.c
test/ippserver.c
test/ipptool.c

index 53cba747cecac938ed3ee5e1c362f4c6f821a642..c0d3579b293e9daaa7eeff252193af73fd0c160a 100644 (file)
@@ -94,7 +94,7 @@ static void           browse_callback(DNSServiceRef sdRef,
                                        const char *serviceName,
                                        const char *regtype,
                                        const char *replyDomain, void *context)
-                                       __attribute__((nonnull(1,5,6,7,8)));
+                                       _CUPS_NONNULL((1,5,6,7,8));
 static void            browse_local_callback(DNSServiceRef sdRef,
                                              DNSServiceFlags flags,
                                              uint32_t interfaceIndex,
@@ -103,7 +103,7 @@ static void         browse_local_callback(DNSServiceRef sdRef,
                                              const char *regtype,
                                              const char *replyDomain,
                                              void *context)
-                                             __attribute__((nonnull(1,5,6,7,8)));
+                                             _CUPS_NONNULL((1,5,6,7,8));
 #endif /* HAVE_DNSSD */
 #ifdef HAVE_AVAHI
 static void            browse_callback(AvahiServiceBrowser *browser,
@@ -121,12 +121,12 @@ static void               client_callback(AvahiClient *client,
 #endif /* HAVE_AVAHI */
 
 static int             compare_devices(cups_device_t *a, cups_device_t *b);
-static void            exec_backend(char **argv) __attribute__((noreturn));
+static void            exec_backend(char **argv) _CUPS_NORETURN;
 static cups_device_t   *get_device(cups_array_t *devices,
                                    const char *serviceName,
                                    const char *regtype,
                                    const char *replyDomain)
-                                   __attribute__((nonnull(1,2,3,4)));
+                                   _CUPS_NONNULL((1,2,3,4));
 #ifdef HAVE_DNSSD
 static void            query_callback(DNSServiceRef sdRef,
                                       DNSServiceFlags flags,
@@ -136,7 +136,7 @@ static void         query_callback(DNSServiceRef sdRef,
                                       uint16_t rrclass, uint16_t rdlen,
                                       const void *rdata, uint32_t ttl,
                                       void *context)
-                                      __attribute__((nonnull(1,5,9,11)));
+                                      _CUPS_NONNULL((1,5,9,11));
 #elif defined(HAVE_AVAHI)
 static int             poll_callback(struct pollfd *pollfds,
                                      unsigned int num_pollfds, int timeout,
@@ -153,7 +153,7 @@ static void         query_callback(AvahiRecordBrowser *browser,
 #endif /* HAVE_DNSSD */
 static void            sigterm_handler(int sig);
 static void            unquote(char *dst, const char *src, size_t dstsize)
-                           __attribute__((nonnull(1,2)));
+                           _CUPS_NONNULL((1,2));
 
 
 /*
index 969083abfdc678fcc4e83aad0cc064d0072961ec..39689b0e47de9a4f5d1470aede877b3eecc468fb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Backend test program for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2005 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -38,7 +38,7 @@ static int    job_canceled = 0;
  */
 
 static void    sigterm_handler(int sig);
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 static void    walk_cb(const char *oid, const char *data, int datalen,
                        void *context);
 
index 4f31d031a8a6a99cc87fc85879a708f6588a4060..4a85b476619e6629e8a9430f459df4639028ae51 100644 (file)
@@ -290,10 +290,10 @@ static void status_timer_cb(CFRunLoopTimerRef timer, void *info);
 
 #if defined(__i386__) || defined(__x86_64__)
 static pid_t   child_pid;              /* Child PID */
-static void run_legacy_backend(int argc, char *argv[], int fd) __attribute__((noreturn));      /* Starts child backend process running as a ppc executable */
+static void run_legacy_backend(int argc, char *argv[], int fd) _CUPS_NORETURN; /* Starts child backend process running as a ppc executable */
 #endif /* __i386__ || __x86_64__ */
 static void sigterm_handler(int sig);  /* SIGTERM handler */
-static void sigquit_handler(int sig, siginfo_t *si, void *unused) __attribute__((noreturn));
+static void sigquit_handler(int sig, siginfo_t *si, void *unused) _CUPS_NORETURN;
 
 #ifdef PARSE_PS_ERRORS
 static const char *next_line (const char *buffer);
index fb6d12139e4e3baf2bd21803324a897b6d024f35..9e30506802d9055ae62bb4ab613614ff094504f4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * "lpq" command for CUPS.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2006 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -26,7 +26,7 @@ static http_t *connect_server(const char *, http_t *);
 static int     show_jobs(const char *, http_t *, const char *,
                          const char *, const int, const int);
 static void    show_printer(const char *, http_t *, const char *);
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 
 
 /*
index cb27164db7c16b1d4065fecdf03b2fc549ea5e2d..6a6fcf47d208edd3d796115adacaaf53ce63d829 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Online help index routines for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -138,11 +138,7 @@ static int         help_load_file(help_index_t *hi,
                                       const char *filename,
                                       const char *relative,
                                       time_t     mtime);
-static help_node_t     *help_new_node(const char *filename, const char *anchor,
-                                      const char *section, const char *text,
-                                      time_t mtime, off_t offset,
-                                      size_t length)
-                                      __attribute__((nonnull(1,3,4)));
+static help_node_t     *help_new_node(const char *filename, const char *anchor, const char *section, const char *text, time_t mtime, off_t offset, size_t length) _CUPS_NONNULL((1, 3, 4));
 static int             help_sort_by_name(help_node_t *p1, help_node_t *p2);
 static int             help_sort_by_score(help_node_t *p1, help_node_t *p2);
 static int             help_sort_words(help_word_t *w1, help_word_t *w2);
index d3fdae04f629a3976bbc27175e8960e1c6e1f09e..17d1834dacda4e8a484ba4c3769d946eb8e535d6 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,11 +1,13 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for CUPS 2.2.9.
+# Generated by GNU Autoconf 2.68 for CUPS 2.2.9.
 #
 # Report bugs to <https://github.com/apple/cups/issues>.
 #
 #
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -134,31 +136,6 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-# Use a proper internal environment variable to ensure we don't fall
-  # into an infinite loop, continuously re-executing ourselves.
-  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
-    _as_can_reexec=no; export _as_can_reexec;
-    # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
-  fi
-  # We don't want this to propagate to other subprocesses.
-          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -192,8 +169,7 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
+test x\$exitcode = x0 || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -238,25 +214,21 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  export CONFIG_SHELL
-             # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       # Preserve -v and -x to the replacement shell.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       case $- in # ((((
+         *v*x* | *x*v* ) as_opts=-vx ;;
+         *v* ) as_opts=-v ;;
+         *x* ) as_opts=-x ;;
+         * ) as_opts= ;;
+       esac
+       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
@@ -359,14 +331,6 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -488,10 +452,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
-  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
-  # already done that, so ensure we don't try to do so again and fall
-  # in an infinite loop.  This has already happened in practice.
-  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -526,16 +486,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
+    # In both cases, we have to default to `cp -p'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
+      as_ln_s='cp -p'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -pR'
+    as_ln_s='cp -p'
   fi
 else
-  as_ln_s='cp -pR'
+  as_ln_s='cp -p'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -547,8 +507,28 @@ else
   as_mkdir_p=false
 fi
 
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -1398,6 +1378,8 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
+    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1730,9 +1712,9 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 CUPS configure 2.2.9
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.68
 
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1883,7 +1865,7 @@ $as_echo "$ac_try_echo"; } >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
-        test -x conftest$ac_exeext
+        $as_test_x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2194,7 +2176,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by CUPS $as_me 2.2.9, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
 
@@ -2684,7 +2666,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CODE_SIGN="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2760,7 +2742,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2808,7 +2790,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2852,7 +2834,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3296,7 +3278,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-struct stat;
+#include <sys/types.h>
+#include <sys/stat.h>
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3546,7 +3529,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3590,7 +3573,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3792,7 +3775,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3832,7 +3815,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3885,7 +3868,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3925,7 +3908,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3965,7 +3948,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4005,7 +3988,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_LD="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4045,7 +4028,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4085,7 +4068,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4125,7 +4108,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4165,7 +4148,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4205,7 +4188,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_RMDIR="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4245,7 +4228,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4285,7 +4268,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_XDGOPEN="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4361,7 +4344,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4404,7 +4387,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4814,7 +4797,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_GREP" || continue
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -4880,7 +4863,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_EGREP" || continue
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -7803,7 +7786,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_KRB5CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7846,7 +7829,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_ac_pt_KRB5CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -8398,7 +8381,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_LIBGNUTLSCONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -8441,7 +8424,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_ac_pt_LIBGNUTLSCONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9000,8 +8983,6 @@ _ACEOF
 esac
 rm -rf conftest*
   fi
-
-
 fi
 
 
@@ -10043,7 +10024,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -10108,7 +10089,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -10173,7 +10154,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PHPCGI="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -10214,7 +10195,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PHP="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -10284,7 +10265,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -10754,16 +10735,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
+    # In both cases, we have to default to `cp -p'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
+      as_ln_s='cp -p'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -pR'
+    as_ln_s='cp -p'
   fi
 else
-  as_ln_s='cp -pR'
+  as_ln_s='cp -p'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -10823,16 +10804,28 @@ else
   as_mkdir_p=false
 fi
 
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -10854,7 +10847,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # values after options handling.
 ac_log="
 This file was extended by CUPS $as_me 2.2.9, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -10917,10 +10910,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 CUPS config.status 2.2.9
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -11009,7 +11002,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
index 3aca6eeddd284571b6ee54d360898f0472ae7057..dc9fe4eb4cfe4925b461db65df14d4eb4786fe23 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Private debugging macros for CUPS.
  *
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2005 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -67,20 +67,10 @@ extern "C" {
  */
 
 #  ifdef DEBUG
-#    ifdef _WIN32
-#      ifdef LIBCUPS2_EXPORTS
-#        define DLLExport __declspec(dllexport)
-#      else
-#        define DLLExport
-#      endif /* LIBCUPS2_EXPORTS */
-#    else
-#      define DLLExport
-#    endif /* _WIN32 */
 #    define DEBUG_puts(x) _cups_debug_puts(x)
 #    define DEBUG_printf(x) _cups_debug_printf x
 #    define DEBUG_set(logfile,level,filter) _cups_debug_set(logfile,level,filter,1)
 #  else
-#    define DLLExport
 #    define DEBUG_puts(x)
 #    define DEBUG_printf(x)
 #    define DEBUG_set(logfile,level,filter)
@@ -93,14 +83,11 @@ extern "C" {
 
 extern int     _cups_debug_fd;
 extern int     _cups_debug_level;
-extern void    DLLExport _cups_debug_printf(const char *format, ...)
-               __attribute__ ((__format__ (__printf__, 1, 2)));
-extern void    DLLExport _cups_debug_puts(const char *s);
-extern void    DLLExport _cups_debug_set(const char *logfile,
-                                         const char *level, const char *filter,
-                                         int force);
+extern void    _cups_debug_printf(const char *format, ...) _CUPS_FORMAT(1, 2);
+extern void    _cups_debug_puts(const char *s);
+extern void    _cups_debug_set(const char *logfile, const char *level, const char *filter, int force) _CUPS_PRIVATE;
 #  ifdef _WIN32
-extern int     _cups_gettimeofday(struct timeval *tv, void *tz);
+extern int     _cups_gettimeofday(struct timeval *tv, void *tz) _CUPS_PRIVATE;
 #    define gettimeofday(a,b) _cups_gettimeofday(a, b)
 #  endif /* _WIN32 */
 
index 43eaad96abd64dfb203f84f97d7e18467ac93bd8..b68f5edbbd24d4a67d59717db274f8d87406d0e7 100644 (file)
@@ -83,7 +83,7 @@ debug_thread_id(void)
  * '_cups_debug_printf()' - Write a formatted line to the log.
  */
 
-void DLLExport
+void
 _cups_debug_printf(const char *format, /* I - Printf-style format string */
                    ...)                        /* I - Additional arguments as needed */
 {
@@ -168,7 +168,7 @@ _cups_debug_printf(const char *format,      /* I - Printf-style format string */
  * '_cups_debug_puts()' - Write a single line to the log.
  */
 
-void DLLExport
+void
 _cups_debug_puts(const char *s)                /* I - String to output */
 {
   struct timeval       curtime;        /* Current time */
@@ -248,7 +248,7 @@ _cups_debug_puts(const char *s)             /* I - String to output */
  * '_cups_debug_set()' - Enable or disable debug logging.
  */
 
-void DLLExport
+void
 _cups_debug_set(const char *logfile,   /* I - Log file or NULL */
                 const char *level,     /* I - Log level or NULL */
                const char *filter,     /* I - Filter string or NULL */
index 73721d46805a68e02022f9f2b2e16066ef2f9f9c..0d3a2e5d3ab79721da7591d571c4e4839b63d78d 100644 (file)
@@ -6,7 +6,7 @@
  * our own file functions allows us to provide transparent support of
  * different line endings, gzip'd print files, PPD files, etc.
  *
- * Copyright 2007-2017 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -85,9 +85,7 @@ extern cups_file_t    *cupsFileOpen(const char *filename, const char *mode)
                        _CUPS_API_1_2;
 extern cups_file_t     *cupsFileOpenFd(int fd, const char *mode) _CUPS_API_1_2;
 extern int             cupsFilePeekChar(cups_file_t *fp) _CUPS_API_1_2;
-extern int             cupsFilePrintf(cups_file_t *fp, const char *format, ...)
-                       __attribute__((__format__ (__printf__, 2, 3)))
-                       _CUPS_API_1_2;
+extern int             cupsFilePrintf(cups_file_t *fp, const char *format, ...) _CUPS_FORMAT(2, 3) _CUPS_API_1_2;
 extern int             cupsFilePutChar(cups_file_t *fp, int c) _CUPS_API_1_2;
 extern ssize_t         cupsFilePutConf(cups_file_t *fp, const char *directive,
                                        const char *value) _CUPS_API_1_4;
index 9cc55e9187b3ecf90aa5f8335afa6f21cbcff27d..e94adae35df04bfd50958f472e27a1800e970406 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Hyper-Text Transport Protocol definitions for CUPS.
  *
- * Copyright 2007-2017 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -480,8 +480,7 @@ extern int          httpHead(http_t *http, const char *uri);
 extern void            httpInitialize(void);
 extern int             httpOptions(http_t *http, const char *uri);
 extern int             httpPost(http_t *http, const char *uri);
-extern int             httpPrintf(http_t *http, const char *format, ...)
-                       __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int             httpPrintf(http_t *http, const char *format, ...) _CUPS_FORMAT(2, 3);
 extern int             httpPut(http_t *http, const char *uri);
 extern int             httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED_MSG("Use httpRead2 instead.");
 extern int             httpReconnect(http_t *http) _CUPS_DEPRECATED_1_6_MSG("Use httpReconnect2 instead.");
index ddec3a958ed1e2f5dead48a21087cdf9316e93de..2c09f2703309553bb84718200aa6c0dbc0c6ca37 100644 (file)
@@ -33,12 +33,8 @@ static ipp_attribute_t       *ipp_add_attr(ipp_t *ipp, const char *name,
                                      int num_values);
 static void            ipp_free_values(ipp_attribute_t *attr, int element,
                                        int count);
-static char            *ipp_get_code(const char *locale, char *buffer,
-                                     size_t bufsize)
-                                     __attribute__((nonnull(1,2)));
-static char            *ipp_lang_code(const char *locale, char *buffer,
-                                      size_t bufsize)
-                                      __attribute__((nonnull(1,2)));
+static char            *ipp_get_code(const char *locale, char *buffer, size_t bufsize) _CUPS_NONNULL((1, 2));
+static char            *ipp_lang_code(const char *locale, char *buffer, size_t bufsize) _CUPS_NONNULL((1, 2));
 static size_t          ipp_length(ipp_t *ipp, int collection);
 static ssize_t         ipp_read_http(http_t *http, ipp_uchar_t *buffer,
                                      size_t length);
index 256cffda462e4ef01f9dbe110e255e74dc8f0b22..f447ef92368d7e816d3624eb2fda0c65356fd211 100644 (file)
@@ -60,16 +60,11 @@ extern const char   *_cupsAppleLocale(CFStringRef languageName, char *locale, size
 #  endif /* __APPLE__ */
 extern void            _cupsCharmapFlush(void);
 extern const char      *_cupsEncodingName(cups_encoding_t encoding);
-extern void            _cupsLangPrintError(const char *prefix,
-                                           const char *message);
-extern int             _cupsLangPrintFilter(FILE *fp, const char *prefix,
-                                            const char *message, ...)
-                       __attribute__ ((__format__ (__printf__, 3, 4)));
-extern int             _cupsLangPrintf(FILE *fp, const char *message, ...)
-                       __attribute__ ((__format__ (__printf__, 2, 3)));
+extern void            _cupsLangPrintError(const char *prefix, const char *message);
+extern int             _cupsLangPrintFilter(FILE *fp, const char *prefix, const char *message, ...) _CUPS_FORMAT(3, 4);
+extern int             _cupsLangPrintf(FILE *fp, const char *message, ...) _CUPS_FORMAT(2, 3);
 extern int             _cupsLangPuts(FILE *fp, const char *message);
-extern const char      *_cupsLangString(cups_lang_t *lang,
-                                        const char *message);
+extern const char      *_cupsLangString(cups_lang_t *lang, const char *message);
 extern void            _cupsMessageFree(cups_array_t *a);
 extern cups_array_t    *_cupsMessageLoad(const char *filename, int unquote);
 extern const char      *_cupsMessageLookup(cups_array_t *a, const char *m);
index 86bd7e793b9ef1fc3dfe99b75f047c3cdb0d74bf..94dd951cb48b8f4c4bb82964c595d58af2b1b827 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Private image library definitions for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1993-2006 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
  * Prototypes...
  */
 
-extern int             _cupsRasterExecPS(cups_page_header2_t *h,
-                                         int *preferred_bits,
-                                         const char *code)
-                                         __attribute__((nonnull(3)));
-extern void            _cupsRasterAddError(const char *f, ...)
-                       __attribute__((__format__(__printf__, 1, 2)));
+extern int             _cupsRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code) _CUPS_NONNULL((3));
+extern void            _cupsRasterAddError(const char *f, ...) _CUPS_FORMAT(1,2);
 extern void            _cupsRasterClearError(void);
 
 #endif /* !_CUPS_RASTER_PRIVATE_H_ */
index 53201f7c43532319a31965e05ff7783345b297dc..ced24923692bd323a79afb3488746bc3ea6389b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Private string definitions for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2006 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -175,8 +175,7 @@ extern size_t _cups_strlcpy(char *, const char *, size_t);
 #  endif /* !HAVE_STRLCPY */
 
 #  ifndef HAVE_SNPRINTF
-extern int     _cups_snprintf(char *, size_t, const char *, ...)
-               __attribute__ ((__format__ (__printf__, 3, 4)));
+extern int     _cups_snprintf(char *, size_t, const char *, ...) _CUPS_FORMAT(3, 4);
 #    define snprintf _cups_snprintf
 #  endif /* !HAVE_SNPRINTF */
 
index c5c20528af0940b609e21713e4737b778252e682..9eab8d2eff74ddab0a4353457e0cfb3cc0b463b9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * CUPS destination API test program for CUPS.
  *
- * Copyright 2012-2017 by Apple Inc.
+ * Copyright 2012-2018 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -32,7 +32,7 @@ static void   show_conflicts(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo,
 static void    show_default(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, const char *option);
 static void    show_media(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, unsigned flags, const char *name);
 static void    show_supported(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, const char *option, const char *value);
-static void    usage(const char *arg) __attribute__((noreturn));
+static void    usage(const char *arg) _CUPS_NORETURN;
 
 
 /*
index 4026a28bc801475c5748a716243d98a806dc1cae..9e168ab75d40db803d4bac53fe853fc887fdacf7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * SNMP test program for CUPS.
  *
- * Copyright 2008-2014 by Apple Inc.
+ * Copyright 2008-2018 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -27,7 +27,7 @@
 static void    print_packet(cups_snmp_t *packet, void *data);
 static int     show_oid(int fd, const char *community,
                         http_addr_t *addr, const char *s, int walk);
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 
 
 /*
index 4065832b1b2274bec1f45e749e3fedda517df6a8..620396f73458e8b322f1b093354c043f5a23c2fe 100644 (file)
 #  define _CUPS_VERSIONING_H_
 
 /*
- * This header defines several constants - _CUPS_DEPRECATED,
- * _CUPS_DEPRECATED_MSG, _CUPS_INTERNAL_MSG, _CUPS_API_major_minor, and
- * _CUPS_API_major_minor_patch - which add compiler-specific attributes that
- * flag functions that are deprecated, added in particular releases, or internal
- * to CUPS.
+ * This header defines several macros that add compiler-specific attributes for
+ * functions:
  *
- * On macOS, the _CUPS_API_* constants are defined based on the values of
- * the MAC_OS_X_VERSION_MIN_ALLOWED and MAC_OS_X_VERSION_MAX_ALLOWED constants
- * provided by the compiler.
+ *   - _CUPS_API_major_minor[_patch]: Specifies when an API became available by
+ *     CUPS version.
+ *   - _CUPS_DEPRECATED: Function is deprecated with no replacement.
+ *   - _CUPS_DEPRECATED_MSG("message"): Function is deprecated and has a
+ *     replacement.
+ *   - _CUPS_FORMAT(format-index, additional-args-index): Function has a
+ *     printf-style format argument followed by zero or more additional
+ *     arguments.  Indices start at 1.
+ *   - _CUPS_INTERNAL: Function is internal with no replacement API.
+ *   - _CUPS_INTERNAL_MSG("msg"): Function is internal - use specified API
+ *     instead.
+ *   - _CUPS_NONNULL((arg list)): Specifies the comma-separated argument indices
+ *     are assumed non-NULL.  Indices start at 1.
+ *   - _CUPS_NORETURN: Specifies the function does not return.
+ *   - _CUPS_PRIVATE: Specifies the function is private to CUPS.
+ *   - _CUPS_PUBLIC: Specifies the function is public API.
  */
 
-#  if defined(__APPLE__) && !defined(_CUPS_SOURCE) && !TARGET_OS_IOS
-#    include <AvailabilityMacros.h>
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER */
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER */
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER */
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER */
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER */
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER */
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER */
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER */
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER */
-#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
-#      define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER __attribute__((unavailable))
-#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER */
-#    define _CUPS_API_1_1_19 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-#    define _CUPS_API_1_1_20 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
-#    define _CUPS_API_1_1_21 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
-#    define _CUPS_API_1_2 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
-#    define _CUPS_API_1_3 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
-#    define _CUPS_API_1_4 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-#    define _CUPS_API_1_5 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-#    define _CUPS_API_1_6 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
-#    define _CUPS_API_1_7 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
-#    define _CUPS_API_2_0 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
-#    define _CUPS_API_2_2 AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
-#    define _CUPS_API_2_2_4 AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
-#    define _CUPS_API_2_2_7
-#  else
-#    define _CUPS_API_1_1_19
-#    define _CUPS_API_1_1_20
-#    define _CUPS_API_1_1_21
-#    define _CUPS_API_1_2
-#    define _CUPS_API_1_3
-#    define _CUPS_API_1_4
-#    define _CUPS_API_1_5
-#    define _CUPS_API_1_6
-#    define _CUPS_API_1_7
-#    define _CUPS_API_2_0
-#    define _CUPS_API_2_2
-#    define _CUPS_API_2_2_4
-#    define _CUPS_API_2_2_7
-#  endif /* __APPLE__ && !_CUPS_SOURCE */
-
 /*
- * With GCC and Clang we can mark old APIs as "deprecated" or "unavailable" with
- * messages so you get warnings/errors are compile-time...
+ * Determine which compiler is being used and what annotation features are
+ * available...
  */
 
+#  ifdef __APPLE__
+#    include <os/availability.h>
+#  endif /* __APPLE__ */
+
 #  ifdef __has_extension               /* Clang */
 #    define _CUPS_HAS_DEPRECATED
+#    define _CUPS_HAS_FORMAT
+#    define _CUPS_HAS_NORETURN
+#    define _CUPS_HAS_VISIBILITY
 #    if __has_extension(attribute_deprecated_with_message)
 #      define _CUPS_HAS_DEPRECATED_WITH_MESSAGE
 #    endif
 #  elif defined(__GNUC__)              /* GCC and compatible */
 #    if __GNUC__ >= 3                  /* GCC 3.0 or higher */
 #      define _CUPS_HAS_DEPRECATED
+#      define _CUPS_HAS_FORMAT
+#      define _CUPS_HAS_NORETURN
+#      define _CUPS_HAS_VISIBILITY
 #    endif /* __GNUC__ >= 3 */
 #    if __GNUC__ >= 5                  /* GCC 5.x */
 #      define _CUPS_HAS_DEPRECATED_WITH_MESSAGE
                                        /* GCC 4.5 or higher */
 #      define _CUPS_HAS_DEPRECATED_WITH_MESSAGE
 #    endif /* __GNUC__ >= 5 */
+#  elif defined(_WIN32)
+#    define __attribute__(...)
 #  endif /* __has_extension */
 
+
+/*
+ * Define _CUPS_INTERNAL, _CUPS_PRIVATE, and _CUPS_PUBLIC visibilty macros for
+ * internal/private/public functions...
+ */
+
+#  ifdef _CUPS_HAS_VISIBILITY
+#    define _CUPS_INTERNAL     __attribute__ ((visibility("hidden")))
+#    define _CUPS_PRIVATE      __attribute__ ((visibility("default")))
+#    define _CUPS_PUBLIC       __attribute__ ((visibility("default")))
+#  else
+#    define _CUPS_INTERNAL
+#    define _CUPS_PRIVATE
+#    define _CUPS_PUBLIC
+#  endif /* _CUPS_HAS_VISIBILITY */
+
+
+/*
+ * Define _CUPS_API_major_minor[_patch] availability macros for CUPS.
+ *
+ * Note: Using any of the _CUPS_API macros automatically adds _CUPS_PUBLIC.
+ */
+
+#  if defined(__APPLE__) && !defined(_CUPS_SOURCE) && !TARGET_OS_IOS
+/*
+ * On Apple operating systems, the _CUPS_API_* constants are defined using the
+ * API_ macros in <os/availability.h>.
+ *
+ * On iOS, we don't actually have libcups available directly, but the supplied
+ * libcups_static target in the Xcode project supports building on iOS 11.0 and
+ * later.
+ */
+#    define _CUPS_API_1_1_19 API_AVAILABLE(macos(10.3), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_1_1_20 API_AVAILABLE(macos(10.4), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_1_1_21 API_AVAILABLE(macos(10.4), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_1_2 API_AVAILABLE(macos(10.5), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_1_3 API_AVAILABLE(macos(10.5), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_1_4 API_AVAILABLE(macos(10.6), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_1_5 API_AVAILABLE(macos(10.7), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_1_6 API_AVAILABLE(macos(10.8), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_1_7 API_AVAILABLE(macos(10.9), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_2_0 API_AVAILABLE(macos(10.10), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_2_2 API_AVAILABLE(macos(10.12), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_2_2_4 API_AVAILABLE(macos(10.13), ios(11.0)) _CUPS_PUBLIC
+#    define _CUPS_API_2_2_7 API_AVAILABLE(macos(10.14), ios(11.0)) _CUPS_PUBLIC
+#  else
+#    define _CUPS_API_1_1_19 _CUPS_PUBLIC
+#    define _CUPS_API_1_1_20 _CUPS_PUBLIC
+#    define _CUPS_API_1_1_21 _CUPS_PUBLIC
+#    define _CUPS_API_1_2 _CUPS_PUBLIC
+#    define _CUPS_API_1_3 _CUPS_PUBLIC
+#    define _CUPS_API_1_4 _CUPS_PUBLIC
+#    define _CUPS_API_1_5 _CUPS_PUBLIC
+#    define _CUPS_API_1_6 _CUPS_PUBLIC
+#    define _CUPS_API_1_7 _CUPS_PUBLIC
+#    define _CUPS_API_2_0 _CUPS_PUBLIC
+#    define _CUPS_API_2_2 _CUPS_PUBLIC
+#    define _CUPS_API_2_2_4 _CUPS_PUBLIC
+#    define _CUPS_API_2_2_7 _CUPS_PUBLIC
+#  endif /* __APPLE__ && !_CUPS_SOURCE */
+
+
+/*
+ * Define _CUPS_DEPRECATED and _CUPS_INTERNAL macros to mark old APIs as
+ * "deprecated" or "unavailable" with messages so you get warnings/errors are
+ * compile-time...
+ *
+ * Note: Using any of the _CUPS_DEPRECATED macros automatically adds
+ * _CUPS_PUBLIC.
+ */
+
 #  if !defined(_CUPS_HAS_DEPRECATED) || (defined(_CUPS_SOURCE) && !defined(_CUPS_NO_DEPRECATED))
     /*
      * Don't mark functions deprecated if the compiler doesn't support it
      * or we are building CUPS source that doesn't care.
      */
-#    define _CUPS_DEPRECATED
-#    define _CUPS_DEPRECATED_MSG(m)
-#    define _CUPS_DEPRECATED_1_6_MSG(m)
-#    define _CUPS_DEPRECATED_1_7_MSG(m)
-#    define _CUPS_INTERNAL_MSG(m)
+#    define _CUPS_DEPRECATED _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_MSG(m) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_2_MSG(m) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_6_MSG(m) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_7_MSG(m) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_2_2_MSG(m) _CUPS_PUBLIC
+#  elif defined(__APPLE__) && defined(_CUPS_NO_DEPRECATED)
+    /*
+     * Compiler supports the unavailable attribute, so use it when the code
+     * wants to exclude the use of deprecated API.
+     */
+#    define _CUPS_DEPRECATED __attribute__ ((unavailable)) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.5)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_6_MSG(m) API_DEPRECATED(m, macos(10.2,10.8)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_7_MSG(m) API_DEPRECATED(m, macos(10.2,10.9)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_2_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.12)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
+
+#  elif defined(__APPLE__)
+    /*
+     * Just mark things as deprecated...
+     */
+#    define _CUPS_DEPRECATED __attribute__ ((deprecated)) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.5)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_6_MSG(m) API_DEPRECATED(m, macos(10.2,10.8)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_7_MSG(m) API_DEPRECATED(m, macos(10.2,10.9)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_2_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.12)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
+
 #  elif defined(_CUPS_HAS_UNAVAILABLE_WITH_MESSAGE) && defined(_CUPS_NO_DEPRECATED)
     /*
      * Compiler supports the unavailable attribute, so use it when the code
      * wants to exclude the use of deprecated API.
      */
-#    define _CUPS_DEPRECATED __attribute__ ((unavailable))
-#    define _CUPS_DEPRECATED_MSG(m) __attribute__ ((unavailable(m)))
-#    define _CUPS_DEPRECATED_1_6_MSG(m) __attribute__ ((unavailable(m)))
-#    define _CUPS_DEPRECATED_1_7_MSG(m) __attribute__ ((unavailable(m)))
-#    define _CUPS_INTERNAL_MSG(m) __attribute__ ((unavailable(m)))
+#    define _CUPS_DEPRECATED __attribute__ ((unavailable)) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_2_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_6_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_1_7_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC
+#    define _CUPS_DEPRECATED_2_2_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC
 #  else
     /*
      * Compiler supports the deprecated attribute, so use it.
      */
-#    define _CUPS_DEPRECATED __attribute__ ((deprecated))
+#    define _CUPS_DEPRECATED __attribute__ ((deprecated)) _CUPS_PUBLIC
 #    ifdef _CUPS_HAS_DEPRECATED_WITH_MESSAGE
-#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated(m)))
+#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC
+#      define _CUPS_DEPRECATED_1_2_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC
+#      define _CUPS_DEPRECATED_1_6_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC
+#      define _CUPS_DEPRECATED_1_7_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC
+#      define _CUPS_DEPRECATED_2_2_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC
 #    else
-#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated))
+#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC
+#      define _CUPS_DEPRECATED_1_2_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC
+#      define _CUPS_DEPRECATED_1_6_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC
+#      define _CUPS_DEPRECATED_1_7_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC
+#      define _CUPS_DEPRECATED_2_2_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC
 #    endif /* _CUPS_HAS_DEPRECATED_WITH_MESSAGE */
-#    if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
-#      define _CUPS_DEPRECATED_1_6_MSG(m) _CUPS_DEPRECATED_MSG(m)
-#    else
-#      define _CUPS_DEPRECATED_1_6_MSG(m)
-#    endif /* MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8 */
-#    if defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
-#      define _CUPS_DEPRECATED_1_7_MSG(m) _CUPS_DEPRECATED_MSG(m)
-#    else
-#      define _CUPS_DEPRECATED_1_7_MSG(m)
-#    endif /* MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_9 */
-#    ifdef _CUPS_SOURCE
-#      define _CUPS_INTERNAL_MSG(m)
-#    elif defined(_CUPS_HAS_UNAVAILABLE_WITH_MESSAGE)
-#      define _CUPS_INTERNAL_MSG(m) __attribute__ ((unavailable(m)))
-#    elif defined(_CUPS_HAS_DEPRECATED_WITH_MESSAGE)
-#      define _CUPS_INTERNAL_MSG(m) __attribute__ ((deprecated(m)))
-#    else
-#      define _CUPS_INTERNAL_MSG(m) __attribute__ ((deprecated))
-#    endif /* _CUPS_SOURCE */
 #  endif /* !_CUPS_HAS_DEPRECATED || (_CUPS_SOURCE && !_CUPS_NO_DEPRECATED) */
 
-#  ifndef __GNUC__
-#    define __attribute__(x)
-#  endif /* !__GNUC__ */
+
+/*
+ * Define _CUPS_FORMAT macro for printf-style functions...
+ */
+
+#  ifdef _CUPS_HAS_FORMAT
+#    define _CUPS_FORMAT(a,b) __attribute__ ((__format__(__printf__, a,b)))
+#  else
+#    define _CUPS_FORMAT(a,b)
+#  endif /* _CUPS_HAS_FORMAT */
+
+
+/*
+ * Define _CUPS_INTERNAL_MSG macro for private APIs that have (historical)
+ * public visibility.
+ *
+ * Note: Using the _CUPS_INTERNAL_MSG macro automatically adds _CUPS_PUBLIC.
+ */
+
+#  ifdef _CUPS_SOURCE
+#    define _CUPS_INTERNAL_MSG(m) _CUPS_PUBLIC
+#  elif defined(_CUPS_HAS_UNAVAILABLE_WITH_MESSAGE)
+#    define _CUPS_INTERNAL_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC
+#  elif defined(_CUPS_HAS_DEPRECATED_WITH_MESSAGE)
+#    define _CUPS_INTERNAL_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC
+#  else
+#    define _CUPS_INTERNAL_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC
+#  endif /* _CUPS_SOURCE */
+
+
+/*
+ * Define _CUPS_NONNULL macro for functions that don't expect non-null
+ * arguments...
+ */
+
+#  ifdef _CUPS_HAS_NONNULL
+#    define _CUPS_NONNULL(...) __attribute__ ((nonnull(__VA_ARGS__)))
+#  else
+#    define _CUPS_NONNULL(...)
+#  endif /* _CUPS_HAS_FORMAT */
+
+
+/*
+ * Define _CUPS_NORETURN macro for functions that don't return.
+ */
+
+#  ifdef _CUPS_HAS_NORETURN
+#    define _CUPS_NORETURN     __attribute__ ((noreturn))
+#  else
+#    define _CUPS_NORETURN
+#  endif /* _CUPS_HAS_NORETURN */
+
 
 #endif /* !_CUPS_VERSIONING_H_ */
index 65a9db993b7ae92fa3788273e2a8d32d01cb345a..fab60d93edb2c98e4840de6db9255b04a5fc620e 100644 (file)
@@ -162,8 +162,7 @@ static ssize_t              copy_trailer(cups_file_t *fp, pstops_doc_t *doc,
                                     ssize_t linelen, size_t linesize);
 static void            do_prolog(pstops_doc_t *doc, ppd_file_t *ppd);
 static void            do_setup(pstops_doc_t *doc, ppd_file_t *ppd);
-static void            doc_printf(pstops_doc_t *doc, const char *format, ...)
-                       __attribute__ ((__format__ (__printf__, 2, 3)));
+static void            doc_printf(pstops_doc_t *doc, const char *format, ...) _CUPS_FORMAT(2, 3);
 static void            doc_puts(pstops_doc_t *doc, const char *s);
 static void            doc_write(pstops_doc_t *doc, const char *s, size_t len);
 static void            end_nup(pstops_doc_t *doc, int number);
index 873c370e6c19f4633dcb534e3ae16066ef6b1c1d..b608367ad2518965e871dc6d84bcb6934791fb9a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Configuration file definitions for the CUPS scheduler.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -279,20 +279,16 @@ extern int        cupsdCheckProgram(const char *filename, cupsd_printer_t *p);
 extern int     cupsdDefaultAuthType(void);
 extern void    cupsdFreeAliases(cups_array_t *aliases);
 extern char    *cupsdGetDateTime(struct timeval *t, cupsd_time_t format);
-extern int     cupsdLogClient(cupsd_client_t *con, int level,
-                               const char *message, ...)
-                               __attribute__((__format__(__printf__, 3, 4)));
+extern int     cupsdLogClient(cupsd_client_t *con, int level, const char *message, ...) _CUPS_FORMAT(3, 4);
 extern void    cupsdLogFCMessage(void *context, _cups_fc_result_t result,
                                  const char *message);
 #ifdef HAVE_GSSAPI
 extern int     cupsdLogGSSMessage(int level, OM_uint32 major_status,
                                   OM_uint32 minor_status,
-                                  const char *message, ...);
+                                  const char *message, ...) _CUPS_FORMAT(4, 5);
 #endif /* HAVE_GSSAPI */
-extern int     cupsdLogJob(cupsd_job_t *job, int level, const char *message,
-                           ...) __attribute__((__format__(__printf__, 3, 4)));
-extern int     cupsdLogMessage(int level, const char *message, ...)
-               __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int     cupsdLogJob(cupsd_job_t *job, int level, const char *message, ...) _CUPS_FORMAT(3, 4);
+extern int     cupsdLogMessage(int level, const char *message, ...) _CUPS_FORMAT(2, 3);
 extern int     cupsdLogPage(cupsd_job_t *job, const char *page);
 extern int     cupsdLogRequest(cupsd_client_t *con, http_status_t code);
 extern int     cupsdReadConfiguration(void);
index aab43a797a429793ed38830ca0b93dd48e877311..6a3c7458f3e2876489002b04cf518d697d77b544 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Sandbox helper for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -37,7 +37,7 @@
  * Local functions...
  */
 
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 
 
 /*
index 08e1abebd883b32bdb81f12a5713287f36f6be30..54d2a4f220b2c6c77033a2748848c442ff8a1dff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Main header file for the CUPS scheduler.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -171,8 +171,7 @@ VAR int                     OnDemand        VALUE(0);
 extern void            cupsdInitEnv(void);
 extern int             cupsdLoadEnv(char *envp[], int envmax);
 extern void            cupsdSetEnv(const char *name, const char *value);
-extern void            cupsdSetEnvf(const char *name, const char *value, ...)
-                       __attribute__ ((__format__ (__printf__, 2, 3)));
+extern void            cupsdSetEnvf(const char *name, const char *value, ...) _CUPS_FORMAT(2, 3);
 extern void            cupsdUpdateEnv(void);
 
 /* file.c */
@@ -196,8 +195,7 @@ extern char         *cupsdMakeUUID(const char *name, int number,
                                       char *buffer, size_t bufsize);
 extern void            cupsdReleaseSignals(void);
 extern void            cupsdSetString(char **s, const char *v);
-extern void            cupsdSetStringf(char **s, const char *f, ...)
-                       __attribute__ ((__format__ (__printf__, 2, 3)));
+extern void            cupsdSetStringf(char **s, const char *f, ...) _CUPS_FORMAT(2, 3);
 
 /* process.c */
 extern void            *cupsdCreateProfile(int job_id, int allow_networking);
index 596b491a4c33a29d626a7bdbe47e4f7ba24180cb..0d1fdb9e0a74b4e399ad6a7add96d35b84d6ed22 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Filtering program for CUPS.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -82,7 +82,7 @@ static int            open_pipe(int *fds);
 static int             read_cups_files_conf(const char *filename);
 static void            set_string(char **s, const char *val);
 static void            sighandler(int sig);
-static void            usage(const char *opt) __attribute__((noreturn));
+static void            usage(const char *opt) _CUPS_NORETURN;
 
 
 /*
index 74566b68a8a6db62bd71a6652fdf4ec6e495f352..6ea3e37f29eb9f59ae4420584e66d332826804bb 100644 (file)
@@ -118,9 +118,7 @@ static void save_auth_info(cupsd_client_t *con, cupsd_job_t *job,
 static void    send_document(cupsd_client_t *con, ipp_attribute_t *uri);
 static void    send_http_error(cupsd_client_t *con, http_status_t status,
                                cupsd_printer_t *printer);
-static void    send_ipp_status(cupsd_client_t *con, ipp_status_t status,
-                               const char *message, ...)
-               __attribute__((__format__(__printf__, 3, 4)));
+static void    send_ipp_status(cupsd_client_t *con, ipp_status_t status, const char *message, ...) _CUPS_FORMAT(3, 4);
 static void    set_default(cupsd_client_t *con, ipp_attribute_t *uri);
 static void    set_job_attrs(cupsd_client_t *con, ipp_attribute_t *uri);
 static void    set_printer_attrs(cupsd_client_t *con, ipp_attribute_t *uri);
index 54f5092d675b1c102fb638586bd5746c316fcfb2..eb59029dddb8eaecf5bf952c9e7b1cfbe7549174 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Print job definitions for the CUPS scheduler.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -164,12 +164,7 @@ extern void                cupsdSaveJob(cupsd_job_t *job);
 extern void            cupsdSetJobHoldUntil(cupsd_job_t *job,
                                             const char *when, int update);
 extern void            cupsdSetJobPriority(cupsd_job_t *job, int priority);
-extern void            cupsdSetJobState(cupsd_job_t *job,
-                                        ipp_jstate_t newstate,
-                                        cupsd_jobaction_t action,
-                                        const char *message, ...)
-                                       __attribute__((__format__(__printf__,
-                                                                 4, 5)));
+extern void            cupsdSetJobState(cupsd_job_t *job, ipp_jstate_t newstate, cupsd_jobaction_t action, const char *message, ...) _CUPS_FORMAT(4, 5);
 extern void            cupsdStopAllJobs(cupsd_jobaction_t action,
                                         int kill_delay);
 extern int             cupsdTimeoutJob(cupsd_job_t *job);
index b17051b71aa106a8d5eff307cb4a174f755b818d..a61592cd82bac3235c739667e82f8f671728a1a5 100644 (file)
@@ -72,7 +72,7 @@ static void           sigterm_handler(int sig);
 static long            select_timeout(int fds);
 static void            service_checkin(void);
 static void            service_checkout(int shutdown);
-static void            usage(int status) __attribute__((noreturn));
+static void            usage(int status) _CUPS_NORETURN;
 
 
 /*
index f8168de9d9ab9b197dd976193e004f54acf84dea..ed9bbc11a608d0d37b0f68663020e282a074bf25 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Private MIME type/conversion database definitions for CUPS.
  *
- * Copyright 2011 by Apple Inc.
+ * Copyright 2011-2018 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -29,8 +29,7 @@ extern "C" {
  * Prototypes...
  */
 
-extern void    _mimeError(mime_t *mime, const char *format, ...)
-               __attribute__ ((__format__ (__printf__, 2, 3)));
+extern void    _mimeError(mime_t *mime, const char *format, ...) _CUPS_FORMAT(2, 3);
 
 
 #  ifdef __cplusplus
index 748f47962e3d445e14a8f2fb2936010cf3da3164..3257ad319181c6d3b47673e857bee5abe47fb46f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * cups-lpd test program for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 2006 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
  */
 
 static int     do_command(int outfd, int infd, const char *command);
-static int     print_job(int outfd, int infd, char *dest, char **args) __attribute__((nonnull(4)));
+static int     print_job(int outfd, int infd, char *dest, char **args) _CUPS_NONNULL((4));
 static int     print_waiting(int outfd, int infd, char *dest);
-static int     remove_job(int outfd, int infd, char *dest, char **args) __attribute__((nonnull(4)));
-static int     status_long(int outfd, int infd, char *dest, char **args) __attribute__((nonnull(4)));
-static int     status_short(int outfd, int infd, char *dest, char **args) __attribute__((nonnull(4)));
-static void    usage(void) __attribute__((noreturn));
+static int     remove_job(int outfd, int infd, char *dest, char **args) _CUPS_NONNULL((4));
+static int     status_long(int outfd, int infd, char *dest, char **args) _CUPS_NONNULL((4));
+static int     status_short(int outfd, int infd, char *dest, char **args) _CUPS_NONNULL((4));
+static void    usage(void) _CUPS_NORETURN;
 
 
 /*
index c1863b23044359b4a76cf10c9bf632214044227d..a190e747e307d04f9e4dc95a58f17d1cb58f1df9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Scheduler speed test for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2005 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -31,7 +31,7 @@
 static int     do_test(const char *server, int port,
                        http_encryption_t encryption, int requests,
                        const char *opstring, int verbose);
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 
 
 /*
index 755e9b362d10ce23cf31e130c83497f4099f763c..35cd3b6b040a1c97b4716db4105d32a831dc285e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Scheduler notification tester for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 2006-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -35,7 +35,7 @@ static int    terminate = 0;
 
 static void    print_attributes(ipp_t *ipp, int indent);
 static void    sigterm_handler(int sig);
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 
 
 /*
index 0e63b9d802776757fe548b0a6bf0ccbfba74fa95..5e458d5922b52479148a1527dde29886e5731c2f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * "cupsaddsmb" command for CUPS.
  *
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 2001-2006 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -37,7 +37,7 @@ const char    *SAMBAUser,
  */
 
 int    export_dest(http_t *http, const char *dest);
-void   usage(void) __attribute__((noreturn));
+void   usage(void) _CUPS_NORETURN;
 
 
 /*
index c9ab991778c9e5fa7013783d8e03534de4ec6dcf..c60c21885f4804354793a148bab590ece5ed7b9e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Scheduler control program for CUPS.
  *
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 2006-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -25,7 +25,7 @@
  * Local functions...
  */
 
-static void    usage(const char *opt) __attribute__((noreturn));
+static void    usage(const char *opt) _CUPS_NORETURN;
 
 
 /*
index 84c4e987ebcd070845c0bb2d0d77f153bef70ebe..093b77ba1485ac4a613fa864711bac358361c4e5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * DSC test program for CUPS.
  *
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 2006 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -27,7 +27,7 @@
  */
 
 static int     check_file(const char *filename);
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 
 
 /*
index d9a2f74ef92f4614e19f56cf8b1ca09d1abb5b7f..c154af2b58390b95b73d2cb383d0325c1de9e45b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PPD test program for CUPS.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -107,7 +107,7 @@ static int  check_translations(ppd_file_t *ppd, int errors, int verbose,
                                   int warn);
 static void    show_conflicts(ppd_file_t *ppd, const char *prefix);
 static int     test_raster(ppd_file_t *ppd, int verbose);
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 static int     valid_path(const char *keyword, const char *path, int errors,
                           int verbose, int warn);
 static int     valid_utf8(const char *s);
index 76a6d780866bb43d47a9a34932d3c94950c0ef27..fceab6d8ee72f86eab8c09198e8ec49ad8bbde41 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Printer option program for CUPS.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2006 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -25,7 +25,7 @@
 
 static void    list_group(ppd_file_t *ppd, ppd_group_t *group);
 static void    list_options(cups_dest_t *dest);
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 
 
 /*
index 8687d053fb2778415e76bbd85e9109b1e9bb0b5a..012609d96b7a1a03f92c673e686dca13c0fd9ab2 100644 (file)
@@ -3,7 +3,7 @@
  * commands such as IPP and Bonjour conformance tests.  This tool is
  * inspired by the UNIX "find" command, thus its name.
  *
- * Copyright 2008-2015 by Apple Inc.
+ * Copyright 2008-2018 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -156,7 +156,7 @@ static void DNSSD_API       browse_callback(DNSServiceRef sdRef,
                                        const char *serviceName,
                                        const char *regtype,
                                        const char *replyDomain, void *context)
-                                       __attribute__((nonnull(1,5,6,7,8)));
+                                       _CUPS_NONNULL((1,5,6,7,8));
 static void DNSSD_API  browse_local_callback(DNSServiceRef sdRef,
                                              DNSServiceFlags flags,
                                              uint32_t interfaceIndex,
@@ -165,7 +165,7 @@ static void DNSSD_API       browse_local_callback(DNSServiceRef sdRef,
                                              const char *regtype,
                                              const char *replyDomain,
                                              void *context)
-                                             __attribute__((nonnull(1,5,6,7,8)));
+                                             _CUPS_NONNULL((1,5,6,7,8));
 #elif defined(HAVE_AVAHI)
 static void            browse_callback(AvahiServiceBrowser *browser,
                                        AvahiIfIndex interface,
@@ -191,7 +191,7 @@ static ippfind_srv_t        *get_service(cups_array_t *services,
                                     const char *serviceName,
                                     const char *regtype,
                                     const char *replyDomain)
-                                    __attribute__((nonnull(1,2,3,4)));
+                                    _CUPS_NONNULL((1,2,3,4));
 static double          get_time(void);
 static int             list_service(ippfind_srv_t *service);
 static ippfind_expr_t  *new_expr(ippfind_op_t op, int invert,
@@ -207,7 +207,7 @@ static void DNSSD_API       resolve_callback(DNSServiceRef sdRef,
                                         uint16_t txtLen,
                                         const unsigned char *txtRecord,
                                         void *context)
-                                        __attribute__((nonnull(1,5,6,9, 10)));
+                                        _CUPS_NONNULL((1,5,6,9, 10));
 #elif defined(HAVE_AVAHI)
 static int             poll_callback(struct pollfd *pollfds,
                                      unsigned int num_pollfds, int timeout,
@@ -227,8 +227,8 @@ static void         resolve_callback(AvahiServiceResolver *res,
                                         void *context);
 #endif /* HAVE_DNSSD */
 static void            set_service_uri(ippfind_srv_t *service);
-static void            show_usage(void) __attribute__((noreturn));
-static void            show_version(void) __attribute__((noreturn));
+static void            show_usage(void) _CUPS_NORETURN;
+static void            show_version(void) _CUPS_NORETURN;
 
 
 /*
index c35c5e6abde9f44fa8bc4d16efaa2bbf4296310e..237727eba52960d9f0a88d86b7457fd243bcb443 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Sample IPP Everywhere server for CUPS.
  *
- * Copyright 2010-2017 by Apple Inc.
+ * Copyright 2010-2018 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -411,8 +411,7 @@ static void         html_escape(_ipp_client_t *client, const char *s,
 static void            html_footer(_ipp_client_t *client);
 static void            html_header(_ipp_client_t *client, const char *title);
 static void            html_printf(_ipp_client_t *client, const char *format,
-                                   ...) __attribute__((__format__(__printf__,
-                                                                  2, 3)));
+                                   ...) _CUPS_FORMAT(2, 3);
 static void            ipp_cancel_job(_ipp_client_t *client);
 static void            ipp_close_job(_ipp_client_t *client);
 static void            ipp_create_job(_ipp_client_t *client);
@@ -437,14 +436,12 @@ static int                register_printer(_ipp_printer_t *printer, const char *location, cons
 static int             respond_http(_ipp_client_t *client, http_status_t code,
                                     const char *content_coding,
                                     const char *type, size_t length);
-static void            respond_ipp(_ipp_client_t *client, ipp_status_t status,
-                                   const char *message, ...)
-                       __attribute__ ((__format__ (__printf__, 3, 4)));
+static void            respond_ipp(_ipp_client_t *client, ipp_status_t status, const char *message, ...) _CUPS_FORMAT(3, 4);
 static void            respond_unsupported(_ipp_client_t *client,
                                            ipp_attribute_t *attr);
 static void            run_printer(_ipp_printer_t *printer);
 static char            *time_string(time_t tv, char *buffer, size_t bufsize);
-static void            usage(int status) __attribute__((noreturn));
+static void            usage(int status) _CUPS_NORETURN;
 static int             valid_doc_attributes(_ipp_client_t *client);
 static int             valid_job_attributes(_ipp_client_t *client);
 
index 4cea4df0b9fe2f6d153ab48d79d4855a2f8d8126..703e6810eccea5f0a61abf7157cc4c276d537393 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * ipptool command for CUPS.
  *
- * Copyright 2007-2017 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -152,11 +152,11 @@ static int        PasswordTries = 0;      /* Number of tries with password */
  * Local functions...
  */
 
-static void    add_stringf(cups_array_t *a, const char *s, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
+static void    add_stringf(cups_array_t *a, const char *s, ...) _CUPS_FORMAT(2, 3);
 static int      compare_uris(const char *a, const char *b);
 static int     compare_vars(_cups_var_t *a, _cups_var_t *b);
 static int     do_tests(cups_file_t *outfile, _cups_vars_t *vars, const char *testfile);
-static void    expand_variables(_cups_vars_t *vars, char *dst, const char *src, size_t dstsize) __attribute__((nonnull(1,2,3)));
+static void    expand_variables(_cups_vars_t *vars, char *dst, const char *src, size_t dstsize) _CUPS_NONNULL((1,2,3));
 static int      expect_matches(_cups_expect_t *expect, ipp_tag_t value_tag);
 static ipp_t   *get_collection(cups_file_t *outfile, _cups_vars_t *vars, cups_file_t *fp, int *linenum);
 static char    *get_filename(const char *testfile, char *dst, const char *src, size_t dstsize);
@@ -168,7 +168,7 @@ static const char *password_cb(const char *prompt);
 static void    pause_message(const char *message);
 static void    print_attr(cups_file_t *outfile, int format, ipp_attribute_t *attr, ipp_tag_t *group);
 static void    print_csv(cups_file_t *outfile, ipp_attribute_t *attr, int num_displayed, char **displayed, size_t *widths);
-static void    print_fatal_error(cups_file_t *outfile, const char *s, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
+static void    print_fatal_error(cups_file_t *outfile, const char *s, ...) _CUPS_FORMAT(2, 3);
 static void    print_line(cups_file_t *outfile, ipp_attribute_t *attr, int num_displayed, char **displayed, size_t *widths);
 static void    print_xml_header(cups_file_t *outfile);
 static void    print_xml_string(cups_file_t *outfile, const char *element, const char *s);
@@ -178,7 +178,7 @@ static void set_variable(cups_file_t *outfile, _cups_vars_t *vars, const char *n
 static void    sigterm_handler(int sig);
 #endif /* _WIN32 */
 static int     timeout_cb(http_t *http, void *user_data);
-static void    usage(void) __attribute__((noreturn));
+static void    usage(void) _CUPS_NORETURN;
 static int     validate_attr(cups_file_t *outfile, cups_array_t *errors, ipp_attribute_t *attr);
 static const char *with_flags_string(int flags);
 static int      with_value(cups_file_t *outfile, cups_array_t *errors, char *value, int flags, ipp_attribute_t *attr, char *matchbuf, size_t matchlen);