mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 15:33:39 +02:00
Fix compilation on Android with the bionic C library
https://bugzilla.gnome.org/show_bug.cgi?id=689223
This commit is contained in:
@@ -23,10 +23,10 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <glib/gprintf.h>
|
||||
#include <conio.h>
|
||||
#endif
|
||||
|
||||
@@ -40,8 +40,12 @@
|
||||
|
||||
G_DEFINE_TYPE (GTlsConsoleInteraction, g_tls_console_interaction, G_TYPE_TLS_INTERACTION);
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#if defined(G_OS_WIN32) || defined(__BIONIC__)
|
||||
/* win32 doesn't have getpass() */
|
||||
#include <stdio.h>
|
||||
#ifndef BUFSIZ
|
||||
#define BUFSIZ 8192
|
||||
#endif
|
||||
static gchar *
|
||||
getpass (const gchar *prompt)
|
||||
{
|
||||
@@ -53,7 +57,11 @@ getpass (const gchar *prompt)
|
||||
|
||||
for (i = 0; i < BUFSIZ - 1; ++i)
|
||||
{
|
||||
#ifdef __BIONIC__
|
||||
buf[i] = getc (stdin);
|
||||
#else
|
||||
buf[i] = _getch ();
|
||||
#endif
|
||||
if (buf[i] == '\r')
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user