mirror of
				https://github.com/zeromq/libzmq.git
				synced 2025-10-30 05:29:43 +01:00 
			
		
		
		
	Fix non-constant-expression narrowing
For OS X, the microseconds field is implemented as an int type. The implicit narrowing in the initializer list throws a compiler error for some compilers with C++11 support turned on. The specific error message is: "error: non-constant-expression cannot be narrowed from type 'long' to '__darwin_suseconds_t' (aka 'int') in initializer list [-Wc++11-narrowing]". Tested on Clang 5.1.0 and Mac OS X 10.9.4.
This commit is contained in:
		| @@ -163,8 +163,12 @@ void zmq::select_t::loop () | ||||
|         memcpy (&exceptfds, &source_set_err, sizeof source_set_err); | ||||
|  | ||||
|         //  Wait for events. | ||||
| #ifdef ZMQ_HAVE_OSX | ||||
|         struct timeval tv = {(long) (timeout / 1000), timeout % 1000 * 1000}; | ||||
| #else | ||||
|         struct timeval tv = {(long) (timeout / 1000), | ||||
|             (long) (timeout % 1000 * 1000)}; | ||||
| #endif | ||||
| #ifdef ZMQ_HAVE_WINDOWS | ||||
|         int rc = select (0, &readfds, &writefds, &exceptfds, | ||||
|             timeout ? &tv : NULL); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Huu Nguyen
					Huu Nguyen