* $Id$
*
* Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2014, 2015, MinGW.org Project
+ * Copyright (C) 2014, 2015, 2017, MinGW.org Project
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* declared; users should NEVER access this, other than via our two
* accessor functions.
*/
-extern unsigned int __mingw_output_format_flag;
+extern unsigned int __mingw_output_format_flags;
static __inline__ __attribute__((__always_inline__))
-unsigned int update_output_format_flag( unsigned int style )
-{ return (__mingw_output_format_flag & ~_EXPONENT_DIGIT_MASK) | style; }
+unsigned int update_output_format_flags( unsigned int style )
+{ return (__mingw_output_format_flags & ~_EXPONENT_DIGIT_MASK) | style; }
#if defined __varofmt__
-/*
- * Here, we actually allocate the storage for recording the preferred
+/* Here, we actually allocate the storage for recording the preferred
* formatting style; although POSIX might lead us to prefer an initial
* default of _TWO_DIGIT_EXPONENT, we choose to assign a default which
* is consistent with Microsoft's preference.
*/
-unsigned int __mingw_output_format_flag = _THREE_DIGIT_EXPONENT;
+unsigned int __mingw_output_format_flags = _THREE_DIGIT_EXPONENT;
#elif defined __crtofmt__
-/*
- * Here we implement the common part of the fallback API, retrieving
- * the value stored in __mingw_output_format_flag. Note that this is
+/* Here we implement the common part of the fallback API, retrieving
+ * the value stored in __mingw_output_format_flags. Note that this is
* sufficient for both _get_output_format() and _set_output_format(),
* with the set action being completed in the calling wrapper.
*/
/* Our replacement function simply returns the current setting of
* the assigned formatting style...
*/
- return __mingw_output_format_flag & _EXPONENT_DIGIT_MASK;
+ return __mingw_output_format_flags & _EXPONENT_DIGIT_MASK;
}
/* ...and, in the case of _set_output_format(), we simply map the
* requisite name to the common function implementation.
__attribute__((__alias__("__mingw_get_output_format_fallback")));
#elif defined __crtnfmt__
-/*
- * Here, we implement a generic fallback hook, suitable for use as the
+/* Here, we implement a generic fallback hook, suitable for use as the
* fallback for _get_printf_count_output()/_set_printf_count_output().
*/
int __mingw_get_printf_count_output_fallback( void )
* _set_output_format() compilation options first.
*/
#if defined __setnfmt__
-/*
- * Here, we are wrapping the _set_printf_count_output() function...
+/* Here, we are wrapping the _set_printf_count_output() function...
*/
# define RTNTYPE int
# define FUNCTION _set_printf_count_output
extern int __mingw_set_printf_count_output_fallback( int );
#elif defined __getnfmt__
-/*
- * ...while here, it is _get_printf_count_output().
+/* ...while here, it is _get_printf_count_output().
*/
# define RTNTYPE int
# define FUNCTION _get_printf_count_output
extern int __mingw_get_printf_count_output_fallback( void );
#elif defined __setofmt__
-/*
- * This is our implementation for the _set_output_format() function,
+/* This is our implementation for the _set_output_format() function,
* which will be called when there is no MSVCRT implementation.
*/
# define RTNTYPE unsigned int
* to use a handler in common with _get_output_format()...
*/
unsigned int retval = api_helper( style &= _EXPONENT_DIGIT_MASK );
- __mingw_output_format_flag = update_output_format_flag( style );
+ __mingw_output_format_flags = update_output_format_flags( style );
return retval;
}
/* ...while declaring its formal prototype as external.
unsigned int api_invoke( unsigned int (*api_helper)( void ) )
{
unsigned int retval = api_helper();
- __mingw_output_format_flag = update_output_format_flag( retval );
+ __mingw_output_format_flags = update_output_format_flags( retval );
return retval;
}
* to support Microsoft's non-standard format specifications.
*
* Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2008, 2009, 2011, 2014-2016, MinGW.org Project
+ * Copyright (C) 2008, 2009, 2011, 2014-2017, MinGW.org Project
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* 2) Emulation of _set_output_format(), through the use of inline
* functions defined in stdio.h, and supported regardless of the
* availability of the API within MSVCRT.DLL; this emulated API
- * maintains state in the global `__mingw_output_format_flag'
+ * maintains state in the global `__mingw_output_format_flags'
* variable, (which users should consider to be private).
*/
-extern unsigned int __mingw_output_format_flag;
+extern unsigned int __mingw_output_format_flags;
static __pformat_inline__
int __pformat_exponent_digits( void )
*/
char *exponent_digits = getenv( "PRINTF_EXPONENT_DIGITS" );
return ((exponent_digits != NULL) && ((unsigned)(*exponent_digits - '0') < 3))
- || (__mingw_output_format_flag & _TWO_DIGIT_EXPONENT)
+ || (__mingw_output_format_flags & _TWO_DIGIT_EXPONENT)
? 2 : 3 ;
}
#else
* to be treated as equivalent to 'L', as it is in MSVCRT.DLL's
* implementation of the printf() functions.
*/
- return (__mingw_output_format_flag & _MSVC_PRINTF_QUIRKS)
+ return (__mingw_output_format_flags & _MSVC_PRINTF_QUIRKS)
? (length == PFORMAT_LENGTH_LONG) : 0;
}
#else