Use __attribute__((format(printf, ...))) directly
Instead of defining the macro _R_(), define __attribute__() as a macro for compilers that do not support __attribute__(), namely Microsoft Visual Studio. Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
@@ -12,8 +12,7 @@ endif
|
||||
|
||||
ACLOCAL_AMFLAGS =-I m4
|
||||
AUTOMAKE_OPTIONS = foreign subdir-objects
|
||||
AM_CPPFLAGS=-I. -I$(srcdir)/include "-D_U_=__attribute__((unused))" \
|
||||
"-D_R_(A,B)=__attribute__((format(printf,A,B)))"
|
||||
AM_CPPFLAGS=-I. -I$(srcdir)/include "-D_U_=__attribute__((unused))"
|
||||
AM_CFLAGS=$(WARN_CFLAGS)
|
||||
|
||||
EXTRA_DIST = autogen.sh COPYING LICENCE-GPL-2.txt LICENCE-LGPL-2.1.txt \
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
AM_CPPFLAGS=-I. -I${srcdir}/../include "-D_U_=__attribute__((unused))" \
|
||||
"-D_R_(A,B)=__attribute__((format(printf,A,B)))"
|
||||
AM_CPPFLAGS=-I. -I${srcdir}/../include "-D_U_=__attribute__((unused))"
|
||||
AM_CFLAGS=$(WARN_CFLAGS)
|
||||
AM_LDFLAGS=-no-undefined
|
||||
LIBS=../lib/libiscsi.la
|
||||
|
||||
@@ -330,13 +330,8 @@ int iscsi_process_reject(struct iscsi_context *iscsi,
|
||||
struct iscsi_in_pdu *in);
|
||||
int iscsi_send_target_nop_out(struct iscsi_context *iscsi, uint32_t ttt, uint32_t lun);
|
||||
|
||||
#if defined(_WIN32)
|
||||
void iscsi_set_error(struct iscsi_context *iscsi, const char *error_string,
|
||||
...);
|
||||
#else
|
||||
void iscsi_set_error(struct iscsi_context *iscsi, const char *error_string,
|
||||
...) __attribute__((format(printf, 2, 3)));
|
||||
#endif
|
||||
|
||||
struct scsi_iovector *iscsi_get_scsi_task_iovector_in(struct iscsi_context *iscsi, struct iscsi_in_pdu *in);
|
||||
struct scsi_iovector *iscsi_get_scsi_task_iovector_out(struct iscsi_context *iscsi, struct iscsi_pdu *pdu);
|
||||
|
||||
@@ -23,8 +23,7 @@ endif
|
||||
libiscsipriv_la_LDFLAGS = -no-undefined
|
||||
|
||||
libiscsipriv_la_CPPFLAGS = -I${srcdir}/../include -I$(srcdir)/include \
|
||||
"-D_U_=__attribute__((unused))" \
|
||||
"-D_R_(A,B)=__attribute__((format(printf,A,B)))"
|
||||
"-D_U_=__attribute__((unused))"
|
||||
|
||||
AM_CFLAGS=$(WARN_CFLAGS)
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
AM_CPPFLAGS=-I. -I${srcdir}/../include \
|
||||
"-D_U_=__attribute__((unused)) " \
|
||||
"-D_R_(A,B)=__attribute__((format(printf,A,B)))"
|
||||
"-D_U_=__attribute__((unused)) "
|
||||
AM_CFLAGS=$(WARN_CFLAGS)
|
||||
AM_LDFLAGS=-no-undefined
|
||||
LIBS = ../lib/libiscsipriv.la
|
||||
|
||||
@@ -65,7 +65,8 @@ extern int loglevel;
|
||||
#define LOG_SILENT 0
|
||||
#define LOG_NORMAL 1
|
||||
#define LOG_VERBOSE 2
|
||||
void logging(int level, const char *format, ...) _R_(2,3);
|
||||
void logging(int level, const char *format, ...)
|
||||
__attribute__((format(printf, 2, 3)));
|
||||
|
||||
/*
|
||||
* define special flags for logging a blank line, so compiler
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
AM_CPPFLAGS = -I${srcdir}/../include "-D_U_=__attribute__((unused))" \
|
||||
"-D_R_(A,B)=__attribute__((format(printf,A,B)))"
|
||||
AM_CPPFLAGS = -I${srcdir}/../include "-D_U_=__attribute__((unused))"
|
||||
AM_CFLAGS = $(WARN_CFLAGS)
|
||||
AM_LDFLAGS = -no-undefined
|
||||
LIBS = ../lib/libiscsi.la
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
AM_CPPFLAGS = -I${srcdir}/../include "-D_U_=__attribute__((unused))" \
|
||||
"-D_R_(A,B)=__attribute__((format(printf,A,B)))"
|
||||
AM_CPPFLAGS = -I${srcdir}/../include "-D_U_=__attribute__((unused))"
|
||||
AM_CFLAGS = $(WARN_CFLAGS)
|
||||
AM_LDFLAGS = -no-undefined
|
||||
LIBS = ../lib/libiscsi.la
|
||||
|
||||
@@ -36,6 +36,10 @@ THE SOFTWARE.
|
||||
#include <malloc.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define __attribute__(attr)
|
||||
#endif
|
||||
|
||||
#define SOL_TCP IPPROTO_TCP
|
||||
|
||||
#if(_WIN32_WINNT < 0x0600)
|
||||
|
||||
Reference in New Issue
Block a user