*
*/
+#include <config.h>
#include "dbus-internals.h"
#include "dbus-sysdeps.h"
#include "dbus-threads.h"
*
* These are the standard ANSI C headers...
*/
+#if HAVE_LOCALE_H
#include <locale.h>
+#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
_dbus_string_get_length (str) - start);
end = NULL;
- errno = 0;
+ _dbus_set_errno_to_zero ();
v = strtol (p, &end, 0);
if (end == NULL || end == p || errno != 0)
return FALSE;
_dbus_string_get_length (str) - start);
end = NULL;
- errno = 0;
+ _dbus_set_errno_to_zero ();
v = strtoul (p, &end, 0);
if (end == NULL || end == p || errno != 0)
return FALSE;
fail_pos = NULL;
+#if HAVE_LOCALECONV
locale_data = localeconv ();
decimal_point = locale_data->decimal_point;
- decimal_point_len = strlen (decimal_point);
+#else
+ decimal_point = ".";
+#endif
+ decimal_point_len = strlen (decimal_point);
_dbus_assert (decimal_point_len != 0);
decimal_point_pos = NULL;
/* Set errno to zero, so that we can distinguish zero results
and underflows */
- errno = 0;
+ _dbus_set_errno_to_zero ();
if (decimal_point_pos)
{
return FALSE;
end = NULL;
- errno = 0;
+ _dbus_set_errno_to_zero ();
v = ascii_strtod (p, &end);
if (end == NULL || end == p || errno != 0)
return FALSE;
}
/**
+ * Converts the current system errno value into a #DBusError name.
+ *
+ * @returns an error name
+ */
+const char*
+_dbus_error_from_system_errno (void)
+{
+ return _dbus_error_from_errno (errno);
+}
+
+/**
* Assign 0 to the global errno variable
*/
void
_dbus_set_errno_to_zero (void)
{
+#ifdef DBUS_WINCE
+ SetLastError (0);
+#else
errno = 0;
+#endif
}
/**