[Groonga-commit] groonga/groonga at 604adb7 [master] suggest: extract zmq compatible macros for zmq >= 3

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jul 11 21:31:53 JST 2013


Kouhei Sutou	2013-07-11 21:31:53 +0900 (Thu, 11 Jul 2013)

  New Revision: 604adb7db13afa9e7d87ee2b8d8720bd01d2fbf3
  https://github.com/groonga/groonga/commit/604adb7db13afa9e7d87ee2b8d8720bd01d2fbf3

  Message:
    suggest: extract zmq compatible macros for zmq >= 3
    
    GitHub: refs #63
    
    Reported by Naoya Inada. Thanks!!!

  Added files:
    src/suggest/zmq_compatible.h
  Modified files:
    src/suggest/groonga_suggest_learner.c
    src/suggest/learner_sources.am

  Modified: src/suggest/groonga_suggest_learner.c (+1 -12)
===================================================================
--- src/suggest/groonga_suggest_learner.c    2013-07-11 21:28:16 +0900 (06f5277)
+++ src/suggest/groonga_suggest_learner.c    2013-07-11 21:31:53 +0900 (988bee6)
@@ -14,7 +14,7 @@
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
-#include <zmq.h>
+#include "zmq_compatible.h"
 #include <stdio.h>
 #include <signal.h>
 #include <unistd.h>
@@ -30,17 +30,6 @@
 
 #include <evhttp.h>
 
-#ifndef ZMQ_SNDHWM
-#   define ZMQ_SNDHWM ZMQ_HWM
-#endif
-
-#if ZMQ_VERSION_MAJOR == 2
-#  define zmq_msg_send(message, socket, flags) \
-  zmq_send((socket), (message), (flags))
-#  define zmq_msg_recv(message, socket, flags) \
-  zmq_recv((socket), (message), (flags))
-#endif
-
 #define DEFAULT_RECV_ENDPOINT "tcp://*:1234"
 #define DEFAULT_SEND_ENDPOINT "tcp://*:1235"
 #define SEND_WAIT 1000 /* 0.001sec */

  Modified: src/suggest/learner_sources.am (+2 -1)
===================================================================
--- src/suggest/learner_sources.am    2013-07-11 21:28:16 +0900 (df2fed9)
+++ src/suggest/learner_sources.am    2013-07-11 21:31:53 +0900 (03b4908)
@@ -1,2 +1,3 @@
 groonga_suggest_learner_SOURCES =		\
-	groonga_suggest_learner.c
+	groonga_suggest_learner.c		\
+	zmq_compatible.h

  Added: src/suggest/zmq_compatible.h (+33 -0) 100644
===================================================================
--- /dev/null
+++ src/suggest/zmq_compatible.h    2013-07-11 21:31:53 +0900 (28bc035)
@@ -0,0 +1,33 @@
+/* -*- c-basic-offset: 2 -*- */
+/* Copyright(C) 2013 Brazil
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License version 2.1 as published by the Free Software Foundation.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+#ifndef GRN_SUGGEST_ZMQ_COMPATIBLE_H
+#define GRN_SUGGEST_ZMQ_COMPATIBLE_H
+
+#include <zmq.h>
+
+#ifndef ZMQ_SNDHWM
+#   define ZMQ_SNDHWM ZMQ_HWM
+#endif
+
+#if ZMQ_VERSION_MAJOR == 2
+#  define zmq_msg_send(message, socket, flags) \
+  zmq_send((socket), (message), (flags))
+#  define zmq_msg_recv(message, socket, flags) \
+  zmq_recv((socket), (message), (flags))
+#endif
+
+#endif /* GRN_SUGGEST_ZMQ_COMPATIBLE_H */
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index