summaryrefslogtreecommitdiffstats
path: root/src/rcctranslate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rcctranslate.c')
-rw-r--r--src/rcctranslate.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rcctranslate.c b/src/rcctranslate.c
index 98c0f1b..7c79d8b 100644
--- a/src/rcctranslate.c
+++ b/src/rcctranslate.c
@@ -87,16 +87,17 @@ int rccTranslateAllowOfflineMode(rcc_translate translate) {
return rccExternalAllowOfflineMode();
}
-#define RCC_UNLOCK_W 1
-#define RCC_UNLOCK_R 2
-#define RCC_UNLOCK_RW 3
-#define RCC_UNLOCK_WR 3
+#ifdef HAVE_LIBTRANSLATE
+# define RCC_UNLOCK_W 1
+# define RCC_UNLOCK_R 2
+# define RCC_UNLOCK_RW 3
+# define RCC_UNLOCK_WR 3
static char *rccTranslateReturn(rcc_translate translate, char *ret, int unlock) {
if (unlock&RCC_UNLOCK_R) rccMutexUnLock(translate->mutex);
if (unlock&RCC_UNLOCK_W) rccMutexUnLock(translate->wmutex);
return ret;
}
-#define rccTranslateReturnNULL(translate, unlock) rccTranslateReturn(translate, NULL, unlock)
+# define rccTranslateReturnNULL(translate, unlock) rccTranslateReturn(translate, NULL, unlock)
static int rccTranslateQueue(rcc_translate translate, const char *buf) {
size_t len, err;
@@ -109,6 +110,7 @@ static int rccTranslateQueue(rcc_translate translate, const char *buf) {
if (!err) err = rccExternalWrite(translate->sock, buf, len + 1, 0);
return err?1:0;
}
+#endif /* HAVE_LIBTRANSLATE */
char *rccTranslate(rcc_translate translate, const char *buf) {
#ifdef HAVE_LIBTRANSLATE