mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-11-04 01:37:31 +03:00 
			
		
		
		
	Fix for MSVC 2015: round has been added to this version
This commit is contained in:
		
							parent
							
								
									4a6b31f56a
								
							
						
					
					
						commit
						9fd5def484
					
				| 
						 | 
					@ -142,16 +142,20 @@ static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* what's this, we have no round function either? */
 | 
				
			||||||
#if (defined(__FreeBSD__) && __FreeBSD_version < 503000) \
 | 
					#if (defined(__FreeBSD__) && __FreeBSD_version < 503000) \
 | 
				
			||||||
    || (defined(_WIN32) && !defined(__GNUC__)) \
 | 
					    || (defined(_WIN32) && !defined(__GNUC__)) \
 | 
				
			||||||
    || (defined(sun) || defined(__sun__)) \
 | 
					    || (defined(sun) || defined(__sun__)) \
 | 
				
			||||||
        && (defined(__SunOS_5_8) || defined(__SunOS_5_9))
 | 
					        && (defined(__SunOS_5_8) || defined(__SunOS_5_9))
 | 
				
			||||||
/* what's this, we have no round function either? */
 | 
					
 | 
				
			||||||
 | 
					/* round has been added in the standard library with MSVC 2015 */
 | 
				
			||||||
 | 
					#if _MSC_VER < 1900
 | 
				
			||||||
static double round(double num)
 | 
					static double round(double num)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  return (num >= 0) ? floor(num + 0.5) : ceil(num - 0.5);
 | 
					  return (num >= 0) ? floor(num + 0.5) : ceil(num - 0.5);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* resolve missing isinf() function for Solaris */
 | 
					/* resolve missing isinf() function for Solaris */
 | 
				
			||||||
#if defined (__SVR4) && defined (__sun)
 | 
					#if defined (__SVR4) && defined (__sun)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user