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); }