Merge all compatibility macros around __func__ and __FUNCTION__

Various parts of SANE introduced their own compatibility macros for
old compilers that don't support __func__.  Most of these definitions
are identical or have minor differences.  This patch replaces them
with a single instance in the central header file for backends.
merge-requests/1/head
Volker Diels-Grabsch 2015-12-05 20:44:14 +01:00 zatwierdzone przez Olaf Meeuwissen
rodzic 7c8c8e29be
commit 93298674d0
9 zmienionych plików z 10 dodań i 50 usunięć

Wyświetl plik

@ -45,13 +45,6 @@
#include "sane/sanei_backend.h"
#include "sane/sanei_debug.h"
#ifdef __GNUC__
#define __func__ __FUNCTION__
#else
#define __func__ "(undef)"
/* I cast my vote for C99... :) */
#endif
#define EPSON2_CONFIG_FILE "epson2.conf"
#ifndef PATH_MAX

Wyświetl plik

@ -43,13 +43,6 @@
#include "sane/sanei_usb.h"
#include "sane/sanei_jpeg.h"
#ifdef __GNUC__
#define __func__ __FUNCTION__
#else
#define __func__ "(undef)"
/* I cast my vote for C99... :) */
#endif
#define EPSONDS_CONFIG_FILE "epsonds.conf"
#ifndef PATH_MAX

Wyświetl plik

@ -73,9 +73,6 @@
/* return if an error occured while the function was called */
#ifdef MAX_DEBUG
# ifndef __FUNCTION__
# define __FUNCTION__ "somewhere"
# endif
# define RIE(function) \
do \

Wyświetl plik

@ -46,12 +46,6 @@
#include "../include/sane/sanei_debug.h"
#include "../include/sane/sanei_backend.h"
#ifdef __GNUC__
#define __func__ __FUNCTION__
#else
#define __func__ "(undef)"
#endif
/* Silence the compiler for unused arguments */
#define NOT_USED(x) ( (void)(x) )

Wyświetl plik

@ -44,13 +44,6 @@
#include "../include/sane/sanei_debug.h"
#include "../include/sane/sanei_backend.h"
#ifdef __GNUC__
#define __func__ __FUNCTION__
#else
#define __func__ "(undef)"
/* I cast my vote for C99... :) */
#endif
/* Silence the compiler for unused arguments */
#define NOT_USED(x) ( (void)(x) )

Wyświetl plik

@ -105,10 +105,6 @@ I hope this makes sense to you (and I got the right idea of the original author'
intention).
***********************************************************************************/
#ifndef __FUNCTION__
#define __FUNCTION__ "(undef)"
#endif
static SANE_Status Source_init (Source *pself,
SnapScan_Scanner *pss,
SourceRemaining remaining,

Wyświetl plik

@ -193,13 +193,6 @@ enum Umax_PP_Configure_Option
NUM_CFG_OPTIONS
};
#if (!defined __GNUC__ || __GNUC__ < 2 || \
__GNUC_MINOR__ < (defined __cplusplus ? 6 : 4))
#define __PRETTY_FUNCTION__ "umax_pp"
#endif
#define DEBUG() DBG(4, "%s(v%d.%d.%d-%s): line %d: debug exception\n", \
__PRETTY_FUNCTION__, SANE_CURRENT_MAJOR, V_MINOR, \
UMAX_PP_BUILD, UMAX_PP_STATE, __LINE__)

Wyświetl plik

@ -28,6 +28,16 @@
*/
#include <sane/sanei_debug.h>
#if __STDC_VERSION__ >= 199901L
/* __func__ is provided */
#elif __GNUC__ >= 5
/* __func__ is provided */
#elif __GNUC__ >= 2
# define __func__ __FUNCTION__
#else
# define __func__ "(unknown)"
#endif
#ifdef HAVE_SYS_HW_H
/* OS/2 i/o-port access compatibility macros: */
# define inb(p) _inp8 (p)

Wyświetl plik

@ -62,15 +62,6 @@
#include <dirent.h>
#include <time.h>
/* for debug messages */
#if __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
# define __func__ __FUNCTION__
# else
# define __func__ "<unknown>"
# endif
#endif
#ifdef HAVE_RESMGR
#include <resmgr.h>