From 9ad40bc89e83cbb8594d79a5a5a7cd19e9be11fe Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Thu, 3 Jan 2002 12:51:25 +0000 Subject: [PATCH] made port->type default stuff compile with gcc 2.95.3 git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3682 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/canon/canon.h | 8 +++++--- camlibs/canon/library.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/camlibs/canon/canon.h b/camlibs/canon/canon.h index 37a2e2514..a2bb3d7b6 100644 --- a/camlibs/canon/canon.h +++ b/camlibs/canon/canon.h @@ -137,16 +137,18 @@ struct _CameraPrivateLibrary /* These contain the default label for all the * switch (camera->port->type) statements */ -#define GP_PORT_DEFAULT_RETURN(RETVAL) \ +#define GP_PORT_DEFAULT_RETURN_INTERNAL(return_statement) \ default: \ gp_camera_set_error (camera, "Don't know how to handle " \ "camera->port->type value %i aka 0x%x" \ "in %s line %i.", camera->port->type, \ camera->port->type, __FILE__, __LINE__); \ - return RETVAL; \ + return_statement; \ break; -#define GP_PORT_DEFAULT GP_PORT_DEFAULT_RETURN(GP_ERROR_BAD_PARAMETERS) +#define GP_PORT_DEFAULT_RETURN_EMPTY GP_PORT_DEFAULT_RETURN_INTERNAL(return) +#define GP_PORT_DEFAULT_RETURN(RETVAL) GP_PORT_DEFAULT_RETURN_INTERNAL(return RETVAL) +#define GP_PORT_DEFAULT GP_PORT_DEFAULT_RETURN(GP_ERROR_BAD_PARAMETERS) /* * All functions returning a pointer have malloc'ed the data. The caller must diff --git a/camlibs/canon/library.c b/camlibs/canon/library.c index e06303a4a..21c398482 100644 --- a/camlibs/canon/library.c +++ b/camlibs/canon/library.c @@ -166,7 +166,7 @@ canon_int_switch_camera_off (Camera *camera) case GP_PORT_USB: GP_DEBUG ("Not trying to shut down USB camera..."); break; - GP_PORT_DEFAULT_RETURN() + GP_PORT_DEFAULT_RETURN_EMPTY } clear_readiness (camera); }