summaryrefslogtreecommitdiff
path: root/camlibs/canon
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-19 00:06:23 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-25 00:20:21 +0200
commit0b2b6207c24bfab3878185d1f907fd0d960931da (patch)
treea9e6773370c5a9f2b7f358031ec15ac35dd0effe /camlibs/canon
parentb6e9e97fe8a12fde1aa3486be563c3362005de8e (diff)
downloadlibgphoto2-0b2b6207c24bfab3878185d1f907fd0d960931da.tar.gz
Factor out i18n stuff into separate i18n.h files
Factor out the i18n definitions into i18n.h include files: One include file each for libgphoto2 and for libgphoto2_port. This removes the complete #ifdef ENABLE_NLS # include <libintl.h> # undef _ # define _(String) dgettext (GETTEXT_PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define _(String) (String) # define N_(String) (String) #endif block (which in some occasions defines even more macros) and replaces it with a single line #include "libgphoto2/i18n.h" for camlibs and libgphoto2 itself and with #include "libgphoto2_port/i18n.h" for iolibs and libgphoto2_port itself. This gives us two central locations to change the defintions.
Diffstat (limited to 'camlibs/canon')
-rw-r--r--camlibs/canon/canon.c15
-rw-r--r--camlibs/canon/crc.c16
-rw-r--r--camlibs/canon/library.c20
-rw-r--r--camlibs/canon/serial.c20
-rw-r--r--camlibs/canon/usb.c20
5 files changed, 10 insertions, 81 deletions
diff --git a/camlibs/canon/canon.c b/camlibs/canon/canon.c
index efa7b3985..86df352b3 100644
--- a/camlibs/canon/canon.c
+++ b/camlibs/canon/canon.c
@@ -33,19 +33,8 @@
#include <gphoto2/gphoto2.h>
#include <gphoto2/gphoto2-port-log.h>
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# undef _
-# define _(String) dgettext (GETTEXT_PACKAGE, String)
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
-#else
-# define _(String) (String)
-# define N_(String) (String)
-#endif
+#include "libgphoto2/i18n.h"
+
#include "usb.h"
#include "util.h"
diff --git a/camlibs/canon/crc.c b/camlibs/canon/crc.c
index 17b8990da..ce862655a 100644
--- a/camlibs/canon/crc.c
+++ b/camlibs/canon/crc.c
@@ -3,21 +3,9 @@
#include <stdlib.h>
#include <stdio.h>
-#include "crc.h"
+#include "libgphoto2/i18n.h"
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# undef _
-# define _(String) dgettext (GETTEXT_PACKAGE, String)
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
-#else
-# define _(String) (String)
-# define N_(String) (String)
-#endif
+#include "crc.h"
/*
diff --git a/camlibs/canon/library.c b/camlibs/canon/library.c
index 51ef59f6d..68c1e5300 100644
--- a/camlibs/canon/library.c
+++ b/camlibs/canon/library.c
@@ -39,24 +39,8 @@
#include <gphoto2/gphoto2.h>
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# undef _
-# define _(String) dgettext (GETTEXT_PACKAGE, String)
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
-#else
-# define textdomain(String) (String)
-# define gettext(String) (String)
-# define dgettext(Domain,Message) (Message)
-# define dcgettext(Domain,Message,Type) (Message)
-# define bindtextdomain(Domain,Directory) (Domain)
-# define _(String) (String)
-# define N_(String) (String)
-#endif
+#include "libgphoto2/i18n.h"
+
#include "util.h"
#include "library.h"
diff --git a/camlibs/canon/serial.c b/camlibs/canon/serial.c
index 7477cd828..7d6b0f0fc 100644
--- a/camlibs/canon/serial.c
+++ b/camlibs/canon/serial.c
@@ -26,24 +26,8 @@
#include <gphoto2/gphoto2.h>
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# undef _
-# define _(String) dgettext (GETTEXT_PACKAGE, String)
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
-#else
-# define textdomain(String) (String)
-# define gettext(String) (String)
-# define dgettext(Domain,Message) (Message)
-# define dcgettext(Domain,Message,Type) (Message)
-# define bindtextdomain(Domain,Directory) (Domain)
-# define _(String) (String)
-# define N_(String) (String)
-#endif
+#include "libgphoto2/i18n.h"
+
#include "library.h"
#include "canon.h"
diff --git a/camlibs/canon/usb.c b/camlibs/canon/usb.c
index c655b3c1d..2583932a7 100644
--- a/camlibs/canon/usb.c
+++ b/camlibs/canon/usb.c
@@ -22,24 +22,8 @@
#include <unistd.h>
#endif /* CANON_EXPERIMENTAL_UPLOAD */
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# undef _
-# define _(String) dgettext (GETTEXT_PACKAGE, String)
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
-#else
-# define textdomain(String) (String)
-# define gettext(String) (String)
-# define dgettext(Domain,Message) (Message)
-# define dcgettext(Domain,Message,Type) (Message)
-# define bindtextdomain(Domain,Directory) (Domain)
-# define _(String) (String)
-# define N_(String) (String)
-#endif
+#include "libgphoto2/i18n.h"
+
#include <gphoto2/gphoto2.h>