/*
******************************************************************************
*
-* Copyright (C) 1998-2010, International Business Machines
+* Copyright (C) 1998-2013, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
******************************************************************************
*/
-/* define for fileno. */
-#ifndef _XOPEN_SOURCE
-#if __STDC_VERSION__ >= 199901L
-/* It is invalid to compile an XPG3, XPG4, XPG4v2 or XPG5 application using c99 */
-#define _XOPEN_SOURCE 600
-#else
-#define _XOPEN_SOURCE 4
-#endif
+/*
+ * fileno is not declared when building with GCC in strict mode.
+ */
+#if defined(__GNUC__) && defined(__STRICT_ANSI__)
+#undef __STRICT_ANSI__
#endif
#include "locmap.h"
#include "cstring.h"
#include "cmemory.h"
-#if defined(U_WINDOWS) && !defined(fileno)
+#if U_PLATFORM_USES_ONLY_WIN32_API && !defined(fileno)
/* Windows likes to rename Unix-like functions */
#define fileno _fileno
#endif
uprv_memset(result, 0, sizeof(UFILE));
result->fFileno = fileno(f);
-#ifdef U_WINDOWS
+#if U_PLATFORM_USES_ONLY_WIN32_API
if (0 <= result->fFileno && result->fFileno <= 2) {
/* stdin, stdout and stderr need to be special cased for Windows 98 */
#if _MSC_VER >= 1400
fclose(systemFile);
}
- return result;
+ return result; /* not a file leak */
}
U_CAPI UFILE* U_EXPORT2
{
return file->fConverter;
}
+#if !UCONFIG_NO_FORMATTING
+U_CAPI const UNumberFormat* U_EXPORT2 u_fgetNumberFormat(UFILE *file)
+{
+ return u_locbund_getNumberFormat(&file->str.fBundle, UNUM_DECIMAL);
+}
+#endif