projects
/
platform
/
upstream
/
glib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix compilation on Android with the bionic C library
[platform/upstream/glib.git]
/
gio
/
tests
/
gtlsconsoleinteraction.c
diff --git
a/gio/tests/gtlsconsoleinteraction.c
b/gio/tests/gtlsconsoleinteraction.c
index
717a83c
..
81e9119
100644
(file)
--- a/
gio/tests/gtlsconsoleinteraction.c
+++ b/
gio/tests/gtlsconsoleinteraction.c
@@
-40,8
+40,12
@@
G_DEFINE_TYPE (GTlsConsoleInteraction, g_tls_console_interaction, G_TYPE_TLS_INTERACTION);
G_DEFINE_TYPE (GTlsConsoleInteraction, g_tls_console_interaction, G_TYPE_TLS_INTERACTION);
-#if
def G_OS_WIN32
+#if
defined(G_OS_WIN32) || defined(__BIONIC__)
/* win32 doesn't have getpass() */
/* win32 doesn't have getpass() */
+#include <stdio.h>
+#ifndef BUFSIZ
+#define BUFSIZ 8192
+#endif
static gchar *
getpass (const gchar *prompt)
{
static gchar *
getpass (const gchar *prompt)
{
@@
-53,7
+57,11
@@
getpass (const gchar *prompt)
for (i = 0; i < BUFSIZ - 1; ++i)
{
for (i = 0; i < BUFSIZ - 1; ++i)
{
+#ifdef __BIONIC__
+ buf[i] = getc (stdin);
+#else
buf[i] = _getch ();
buf[i] = _getch ();
+#endif
if (buf[i] == '\r')
break;
}
if (buf[i] == '\r')
break;
}