Allow predefining wxHAS_MODE_T to avoid mode_t conflicts
This symbol can now be predefined to avoid conflicts with mode_t definition in wx/filefn.h when wxWidgets is used in applications also using another library which also defines mode_t. Closes https://github.com/wxWidgets/wxWidgets/pull/165
This commit is contained in:
		@@ -199,6 +199,13 @@ Currently the following symbols exist:
 | 
				
			|||||||
@itemdef{wxHAS_RAW_KEY_CODES, Defined if raw key codes (see wxKeyEvent::GetRawKeyCode are supported.}
 | 
					@itemdef{wxHAS_RAW_KEY_CODES, Defined if raw key codes (see wxKeyEvent::GetRawKeyCode are supported.}
 | 
				
			||||||
@itemdef{wxHAS_REGEX_ADVANCED, Defined if advanced syntax is available in wxRegEx.}
 | 
					@itemdef{wxHAS_REGEX_ADVANCED, Defined if advanced syntax is available in wxRegEx.}
 | 
				
			||||||
@itemdef{wxHAS_TASK_BAR_ICON, Defined if wxTaskBarIcon is available on the current platform.}
 | 
					@itemdef{wxHAS_TASK_BAR_ICON, Defined if wxTaskBarIcon is available on the current platform.}
 | 
				
			||||||
 | 
					@itemdef{wxHAS_MODE_T, Defined when wxWidgets defines @c mode_t typedef for the
 | 
				
			||||||
 | 
					    compilers not providing it. If another library used in a wxWidgets
 | 
				
			||||||
 | 
					    application, such as ACE (http://www.cs.wustl.edu/~schmidt/ACE.html), also
 | 
				
			||||||
 | 
					    defines @c mode_t, this symbol can be predefined after including the other
 | 
				
			||||||
 | 
					    library header, such as @c "ace/os_include/sys/os_types.h" in ACE case,
 | 
				
			||||||
 | 
					    but before including any wxWidgets headers, to prevent a definition
 | 
				
			||||||
 | 
					    conflict.}
 | 
				
			||||||
@endDefList
 | 
					@endDefList
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,7 +44,10 @@
 | 
				
			|||||||
// constants
 | 
					// constants
 | 
				
			||||||
// ----------------------------------------------------------------------------
 | 
					// ----------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(__VISUALC__)
 | 
					// MSVC doesn't define mode_t, so do it ourselves unless someone else
 | 
				
			||||||
 | 
					// had already predefined it.
 | 
				
			||||||
 | 
					#if defined(__VISUALC__) && !defined(wxHAS_MODE_T)
 | 
				
			||||||
 | 
					    #define wxHAS_MODE_T
 | 
				
			||||||
    typedef int mode_t;
 | 
					    typedef int mode_t;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user