You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2018/11/30 02:21:48 UTC

[GitHub] vongosling closed pull request #15: Dependency c header instead of cpp header

vongosling closed pull request #15: Dependency c header instead of cpp header
URL: https://github.com/apache/rocketmq-client-cpp/pull/15
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index b8806dfc..5392977d 100644
--- a/README.md
+++ b/README.md
@@ -82,34 +82,6 @@ then execute follow command will auto use these library files to build rocketmq-
 
     win32_build.bat build
 
-	
-
-
-=======
-#### Dependency Installation
-1. install [libevent 2.0.22](https://github.com/libevent/libevent/archive/release-2.0.22-stable.zip "libevent 2.0.22")
-extract libevent to C:/libevent
-open Virtual Studio command line tools, go to dir: C:/libevent
-execute cmd: nmake /f Makefile.nmake
-cp libevent.lib, libevent_extras.lib and libevent_core.lib to C:/libevent/lib
-
-1. install [jsoncpp 0.10.6](https://github.com/open-source-parsers/jsoncpp/archive/0.10.6.zip "jsoncpp 0.10.6")
-extract jsoncpp to C:/jsoncpp
-download [cmake windows tool](https://cmake.org/files/v3.9/cmake-3.9.3-win64-x64.zip "cmake windows tool") and extract
-run cmake-gui.exe, choose your source code dir and build dir, then click generate which will let you choose Virtual Studio version
-open project by VirtualStudio, and build jsoncpp, and jsoncpp.lib will be got
-
-1. install [boost 1.58.0](http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.gz "boost 1.58.0")
-according to following discription: http://www.boost.org/doc/libs/1_56_0/more/getting_started/windows.html
-following build options are needed to be set when run bjam.exe: msvc architecture=x86 address-model=64 link=static runtime-link=static stage
-all lib will be generated except boost_zlib:
-download [zlib source](http://gnuwin32.sourceforge.net/downlinks/zlib-src-zip.php "zlib source") and extract to directory C:/zlib
-run cmd:bjam.exe msvc architecture=x86 address-model=64 link=static runtime-link=static --with-iostreams -s ZLIB_SOURCE=C:\zlib\src\zlib\1.2.3\zlib-1.2.3 stage
-
-#### Make and Install
-run cmake-gui.exe, choose your source code dir and build dir, then click generate which will let you choose VirtualStudio version
-if generate project solution fails, change BOOST_INCLUDEDIR/LIBEVENT_INCLUDE_DIR/JSONCPP_INCLUDE_DIR in CMakeList.txt, according to its real install path
-open&build&run project by VirtualStudio
 
 ## Quick Start ##
 ### tools and commands ###
diff --git a/include/CCommon.h b/include/CCommon.h
index a5d04b7b..7fcf680a 100644
--- a/include/CCommon.h
+++ b/include/CCommon.h
@@ -40,10 +40,31 @@ typedef enum _CLogLevel_{
     E_LOG_LEVEL_TRACE = 6,
     E_LOG_LEVEL_LEVEL_NUM = 7
 } CLogLevel;
+
+
+#ifdef WIN32
+#ifdef ROCKETMQCLIENT_EXPORTS
+#ifdef _WINDLL
+#define ROCKETMQCLIENT_API __declspec(dllexport)
+#else
+#define ROCKETMQCLIENT_API
+#endif
+#else
+#ifdef ROCKETMQCLIENT_IMPORT
+#define ROCKETMQCLIENT_API __declspec(dllimport)
+#else
+#define ROCKETMQCLIENT_API
+#endif
+#endif
+#else
+#define ROCKETMQCLIENT_API
+#endif
+
 typedef enum _CMessageModel_{
     BROADCASTING,
     CLUSTERING
 } CMessageModel;
+
 #ifdef __cplusplus
 };
 #endif
diff --git a/include/CMessage.h b/include/CMessage.h
index 04fc052c..cef7889e 100644
--- a/include/CMessage.h
+++ b/include/CMessage.h
@@ -17,7 +17,7 @@
 
 #ifndef __C_MESSAGE_H__
 #define __C_MESSAGE_H__
-#include "RocketMQClient.h"
+#include "CCommon.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/CMessageExt.h b/include/CMessageExt.h
index 18118268..26336aaa 100644
--- a/include/CMessageExt.h
+++ b/include/CMessageExt.h
@@ -18,7 +18,7 @@
 #ifndef __C_MESSAGE_EXT_H__
 #define __C_MESSAGE_EXT_H__
 
-#include "RocketMQClient.h"
+#include "CCommon.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/CProducer.h b/include/CProducer.h
index f9ba9518..74bdb9d8 100644
--- a/include/CProducer.h
+++ b/include/CProducer.h
@@ -18,6 +18,7 @@
 #ifndef __C_PRODUCER_H__
 #define __C_PRODUCER_H__
 
+#include "CCommon.h"
 #include "CMessage.h"
 #include "CSendResult.h"
 
diff --git a/include/CPullConsumer.h b/include/CPullConsumer.h
index 6b86a20a..8c7f9002 100644
--- a/include/CPullConsumer.h
+++ b/include/CPullConsumer.h
@@ -18,6 +18,7 @@
 #ifndef __C_PULL_CONSUMER_H__
 #define __C_PULL_CONSUMER_H__
 
+#include "CCommon.h"
 #include "CMessageExt.h"
 #include "CMessageQueue.h"
 #include "CPullResult.h"
diff --git a/include/MQClientException.h b/include/MQClientException.h
index 9b641978..bf29863a 100755
--- a/include/MQClientException.h
+++ b/include/MQClientException.h
@@ -23,6 +23,7 @@
 #include <string>
 #include "RocketMQClient.h"
 
+
 namespace rocketmq {
 //<!***************************************************************************
 class ROCKETMQCLIENT_API MQException : public std::exception {
diff --git a/include/MQMessage.h b/include/MQMessage.h
index ec637cad..9c14e541 100755
--- a/include/MQMessage.h
+++ b/include/MQMessage.h
@@ -23,6 +23,7 @@
 #include <vector>
 #include "RocketMQClient.h"
 
+
 namespace rocketmq {
 //<!***************************************************************************
 class ROCKETMQCLIENT_API MQMessage {
diff --git a/src/common/ByteOrder.h b/src/common/ByteOrder.h
index 9cafc4c5..e626b725 100755
--- a/src/common/ByteOrder.h
+++ b/src/common/ByteOrder.h
@@ -1,18 +1,18 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
 */
 #ifndef BYTEORDER_H_INCLUDED
 #define BYTEORDER_H_INCLUDED
diff --git a/src/common/ClientRPCHook.h b/src/common/ClientRPCHook.h
index 8abab31c..853917df 100755
--- a/src/common/ClientRPCHook.h
+++ b/src/common/ClientRPCHook.h
@@ -19,7 +19,6 @@
 #define __CLIENTRPCHOOK_H__
 
 #include "RemotingCommand.h"
-#include "RocketMQClient.h"
 #include "SessionCredentials.h"
 namespace rocketmq {
 class RPCHook {
diff --git a/src/common/InputStream.h b/src/common/InputStream.h
index 9693472d..d3916c48 100755
--- a/src/common/InputStream.h
+++ b/src/common/InputStream.h
@@ -1,19 +1,19 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef INPUTSTREAM_H_INCLUDED
 #define INPUTSTREAM_H_INCLUDED
diff --git a/src/common/OutputStream.h b/src/common/OutputStream.h
index 76c5866d..30ca334f 100755
--- a/src/common/OutputStream.h
+++ b/src/common/OutputStream.h
@@ -1,19 +1,19 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 #ifndef OUTPUTSTREAM_H_INCLUDED
 #define OUTPUTSTREAM_H_INCLUDED
diff --git a/src/common/dataBlock.h b/src/common/dataBlock.h
index 750b8313..17930f7f 100755
--- a/src/common/dataBlock.h
+++ b/src/common/dataBlock.h
@@ -1,18 +1,18 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
 */
 #ifndef __DATABLOCK_H__
 #define __DATABLOCK_H__
diff --git a/src/consumer/AllocateMQStrategy.h b/src/consumer/AllocateMQStrategy.h
index 343752e6..fbe501a1 100755
--- a/src/consumer/AllocateMQStrategy.h
+++ b/src/consumer/AllocateMQStrategy.h
@@ -21,7 +21,6 @@
 #include "Logging.h"
 #include "MQClientException.h"
 #include "MQMessageQueue.h"
-#include "RocketMQClient.h"
 
 namespace rocketmq {
 //<!***************************************************************************
diff --git a/src/consumer/OffsetStore.h b/src/consumer/OffsetStore.h
index 269198fa..7e8d8c32 100755
--- a/src/consumer/OffsetStore.h
+++ b/src/consumer/OffsetStore.h
@@ -22,7 +22,6 @@
 #include <boost/thread/thread.hpp>
 #include <map>
 #include "MQMessageQueue.h"
-#include "RocketMQClient.h"
 #include "SessionCredentials.h"
 
 namespace rocketmq {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services