svn commit: samba r25267 - in branches/SAMBA_4_0: . source/include source/lib/util

jelmer at samba.org jelmer at samba.org
Fri Sep 21 02:00:52 GMT 2007


Author: jelmer
Date: 2007-09-21 02:00:50 +0000 (Fri, 21 Sep 2007)
New Revision: 25267

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25267

Log:
Move PRINTF_ATTRIBUTE to lib/util as well.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/include/includes.h
   branches/SAMBA_4_0/source/lib/util/attr.h
   branches/SAMBA_4_0/source/lib/util/util.h


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/include/includes.h
===================================================================
--- branches/SAMBA_4_0/source/include/includes.h	2007-09-21 00:42:51 UTC (rev 25266)
+++ branches/SAMBA_4_0/source/include/includes.h	2007-09-21 02:00:50 UTC (rev 25267)
@@ -32,30 +32,17 @@
 
 #include "local.h"
 
-#ifndef PRINTF_ATTRIBUTE
-#if __GNUC__ >= 3
-/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
- * the parameter containing the format, and a2 the index of the first
- * argument. Note that some gcc 2.x versions don't handle this
- * properly **/
-#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
-#else
-#define PRINTF_ATTRIBUTE(a1, a2)
-#endif
-#endif
-
 #include "system/time.h"
 #include "system/wait.h"
 
-#ifndef _PRINTF_ATTRIBUTE
-#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
-#endif
-
 /* Lists, trees, caching, database... */
 #include <stdlib.h>
 #include <stdbool.h>
 #include <talloc.h>
 #include "libcli/util/nt_status.h"
+#ifndef _PRINTF_ATTRIBUTE
+#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
+#endif
 #include "charset/charset.h"
 #include "util/util.h"
 #include "librpc/gen_ndr/misc.h"

Modified: branches/SAMBA_4_0/source/lib/util/attr.h
===================================================================
--- branches/SAMBA_4_0/source/lib/util/attr.h	2007-09-21 00:42:51 UTC (rev 25266)
+++ branches/SAMBA_4_0/source/lib/util/attr.h	2007-09-21 02:00:50 UTC (rev 25267)
@@ -77,4 +77,16 @@
 #endif
 #endif
 
+#ifndef PRINTF_ATTRIBUTE
+#if __GNUC__ >= 3
+/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
+ * the parameter containing the format, and a2 the index of the first
+ * argument. Note that some gcc 2.x versions don't handle this
+ * properly **/
+#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#else
+#define PRINTF_ATTRIBUTE(a1, a2)
+#endif
+#endif
+
 #endif /* __UTIL_ATTR_H__ */

Modified: branches/SAMBA_4_0/source/lib/util/util.h
===================================================================
--- branches/SAMBA_4_0/source/lib/util/util.h	2007-09-21 00:42:51 UTC (rev 25266)
+++ branches/SAMBA_4_0/source/lib/util/util.h	2007-09-21 02:00:50 UTC (rev 25267)
@@ -165,7 +165,7 @@
   @note You should never have to call this function directly. Call the DEBUG()
   macro instead.
 */
-_PUBLIC_ void do_debug(const char *format, ...) _PRINTF_ATTRIBUTE(1,2);
+_PUBLIC_ void do_debug(const char *format, ...) PRINTF_ATTRIBUTE(1,2);
 
 /**
   reopen the log file (usually called because the log file name might have changed)
@@ -313,9 +313,9 @@
 
 /* The following definitions come from lib/util/dprintf.c  */
 
-_PUBLIC_ int d_vfprintf(FILE *f, const char *format, va_list ap) _PRINTF_ATTRIBUTE(2,0);
-_PUBLIC_ int d_fprintf(FILE *f, const char *format, ...) _PRINTF_ATTRIBUTE(2,3);
-_PUBLIC_ int d_printf(const char *format, ...) _PRINTF_ATTRIBUTE(1,2);
+_PUBLIC_ int d_vfprintf(FILE *f, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
+_PUBLIC_ int d_fprintf(FILE *f, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
+_PUBLIC_ int d_printf(const char *format, ...) PRINTF_ATTRIBUTE(1,2);
 _PUBLIC_ void display_set_stderr(void);
 
 /* The following definitions come from lib/util/util_str.c  */
@@ -604,8 +604,8 @@
   save a lump of data into a file. Mostly used for debugging 
 */
 _PUBLIC_ bool file_save(const char *fname, const void *packet, size_t length);
-_PUBLIC_ int vfdprintf(int fd, const char *format, va_list ap) _PRINTF_ATTRIBUTE(2,0);
-_PUBLIC_ int fdprintf(int fd, const char *format, ...) _PRINTF_ATTRIBUTE(2,3);
+_PUBLIC_ int vfdprintf(int fd, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
+_PUBLIC_ int fdprintf(int fd, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
 _PUBLIC_ bool large_file_support(const char *path);
 
 /* The following definitions come from lib/util/util.c  */



More information about the samba-cvs mailing list