clang on windows support

This commit is contained in:
wuggy 2026-09-10 08:32:59 -07:00
commit 1d44f05fba
22 changed files with 208 additions and 65 deletions

View file

@ -39,11 +39,12 @@ if CONFIG['OS_TARGET'] != 'Android':
DEFINES['FAKE_LOG_DEVICE'] = True
SOURCES += [
'system/core/liblog/fake_log_device.c',
# io.h conflicts with the access stub in logd_write.c on Windows.
'system/core/liblog/logprint.c',
]
UNIFIED_SOURCES += [
'system/core/libcutils/strdup16to8.c',
'system/core/liblog/logd_write.c',
'system/core/liblog/logprint.c',
]
EXPORTS.mp4_demuxer += [

View file

@ -26,6 +26,12 @@
#include <assert.h>
#include <arpa/inet.h>
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
#include <log/logd.h>
#include <log/logprint.h>
@ -945,7 +951,11 @@ int android_log_printLogLine(
return -1;
do {
#ifdef _WIN32
ret = _write(fd, outBuffer, totalLen);
#else
ret = write(fd, outBuffer, totalLen);
#endif
} while (ret < 0 && errno == EINTR);
if (ret < 0) {