mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 11:49:12 +00:00 
			
		
		
		
	Fix C++ header usage. This __STDC_LIMIT_MACROS scheme can still be subverted
by including stdint.h before mpdecimal.h. In that case the only option left is to compile with -D_STDC_LIMIT_MACROS.
This commit is contained in:
		
							parent
							
								
									956040a7cc
								
							
						
					
					
						commit
						01e5f800b4
					
				
					 1 changed files with 11 additions and 9 deletions
				
			
		| 
						 | 
					@ -32,6 +32,10 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __cplusplus
 | 
					#ifdef __cplusplus
 | 
				
			||||||
extern "C" {
 | 
					extern "C" {
 | 
				
			||||||
 | 
					  #ifndef __STDC_LIMIT_MACROS
 | 
				
			||||||
 | 
					    #define __STDC_LIMIT_MACROS
 | 
				
			||||||
 | 
					    #define MPD_CLEAR_STDC_LIMIT_MACROS
 | 
				
			||||||
 | 
					  #endif
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,18 +59,12 @@ extern "C" {
 | 
				
			||||||
  #define MPD_HIDE_SYMBOLS_END
 | 
					  #define MPD_HIDE_SYMBOLS_END
 | 
				
			||||||
  #define EXTINLINE extern inline
 | 
					  #define EXTINLINE extern inline
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
 | 
					  #ifdef HAVE_STDINT_H
 | 
				
			||||||
 | 
					    #include <stdint.h>
 | 
				
			||||||
 | 
					  #endif
 | 
				
			||||||
  #ifdef HAVE_INTTYPES_H
 | 
					  #ifdef HAVE_INTTYPES_H
 | 
				
			||||||
    #include <inttypes.h>
 | 
					    #include <inttypes.h>
 | 
				
			||||||
  #endif
 | 
					  #endif
 | 
				
			||||||
  #ifdef HAVE_STDINT_H
 | 
					 | 
				
			||||||
    #if defined(__cplusplus) && !defined(__STDC_LIMIT_MACROS)
 | 
					 | 
				
			||||||
      #define __STDC_LIMIT_MACROS
 | 
					 | 
				
			||||||
      #include <stdint.h>
 | 
					 | 
				
			||||||
      #undef __STDC_LIMIT_MACROS
 | 
					 | 
				
			||||||
    #else
 | 
					 | 
				
			||||||
      #include <stdint.h>
 | 
					 | 
				
			||||||
    #endif
 | 
					 | 
				
			||||||
  #endif
 | 
					 | 
				
			||||||
  #ifndef __GNUC_STDC_INLINE__
 | 
					  #ifndef __GNUC_STDC_INLINE__
 | 
				
			||||||
    #define __GNUC_STDC_INLINE__ 1
 | 
					    #define __GNUC_STDC_INLINE__ 1
 | 
				
			||||||
  #endif
 | 
					  #endif
 | 
				
			||||||
| 
						 | 
					@ -835,6 +833,10 @@ MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __cplusplus
 | 
					#ifdef __cplusplus
 | 
				
			||||||
 | 
					  #ifdef MPD_CLEAR_STDC_LIMIT_MACROS
 | 
				
			||||||
 | 
					    #undef MPD_CLEAR_STDC_LIMIT_MACROS
 | 
				
			||||||
 | 
					    #undef __STDC_LIMIT_MACROS
 | 
				
			||||||
 | 
					  #endif
 | 
				
			||||||
} /* END extern "C" */
 | 
					} /* END extern "C" */
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue