mirror of
				https://github.com/zeromq/cppzmq.git
				synced 2025-10-26 02:18:06 +01:00 
			
		
		
		
	fix build error with libzmq-3.2.5 (#103)
error zmq_send_const undefined and zmq_msg_gets undefined
This commit is contained in:
		
							
								
								
									
										6
									
								
								zmq.hpp
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								zmq.hpp
									
									
									
									
									
								
							| @@ -372,6 +372,7 @@ namespace zmq | |||||||
|             return a == b; |             return a == b; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | #if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 0, 8) | ||||||
|         inline const char* gets(const char *property_) |         inline const char* gets(const char *property_) | ||||||
|         { |         { | ||||||
|             const char* value = zmq_msg_gets (&msg, property_); |             const char* value = zmq_msg_gets (&msg, property_); | ||||||
| @@ -379,6 +380,7 @@ namespace zmq | |||||||
|                 throw error_t (); |                 throw error_t (); | ||||||
|             return value; |             return value; | ||||||
|         } |         } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|     private: |     private: | ||||||
|         //  The underlying message |         //  The underlying message | ||||||
| @@ -622,7 +624,11 @@ namespace zmq | |||||||
|  |  | ||||||
|         inline size_t send (const void *buf_, size_t len_, int flags_ = 0) |         inline size_t send (const void *buf_, size_t len_, int flags_ = 0) | ||||||
|         { |         { | ||||||
|  | #if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 0, 8) | ||||||
|             int nbytes = zmq_send_const (ptr, buf_, len_, flags_); |             int nbytes = zmq_send_const (ptr, buf_, len_, flags_); | ||||||
|  | #else | ||||||
|  |             int nbytes = zmq_send (ptr, buf_, len_, flags_); | ||||||
|  | #endif | ||||||
|             if (nbytes >= 0) |             if (nbytes >= 0) | ||||||
|                 return (size_t) nbytes; |                 return (size_t) nbytes; | ||||||
|             if (zmq_errno () == EAGAIN) |             if (zmq_errno () == EAGAIN) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Rider Woo
					Rider Woo