mirror of https://gitee.com/openkylin/qemu.git
Merge branch 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber
* 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber: Darwin: Fix compilation warning regarding the deprecated daemon() function cocoa: Avoid warning related to multiple handleEvent: definitions cocoa: Revert dependency on VNC cocoa: Provide central qemu_main() prototype Fix libfdt warnings on Darwin configure: Fix check for fdatasync() Remove warning in printf due to type mismatch Cocoa: avoid displaying window when command-line contains '-h' or '-help' Fix compilation warning due to incorrectly specified type cocoa: do not create a spurious window for -version
This commit is contained in:
commit
22e1e72960
|
@ -128,6 +128,7 @@ common-obj-y += $(addprefix audio/, $(audio-obj-y))
|
|||
|
||||
ui-obj-y += keymaps.o
|
||||
ui-obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
|
||||
ui-obj-$(CONFIG_COCOA) += cocoa.o
|
||||
ui-obj-$(CONFIG_CURSES) += curses.o
|
||||
vnc-obj-y += vnc.o d3des.o
|
||||
vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o
|
||||
|
@ -135,7 +136,6 @@ vnc-obj-y += vnc-enc-tight.o vnc-palette.o
|
|||
vnc-obj-y += vnc-enc-zrle.o
|
||||
vnc-obj-$(CONFIG_VNC_TLS) += vnc-tls.o vnc-auth-vencrypt.o
|
||||
vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
|
||||
vnc-obj-$(CONFIG_COCOA) += cocoa.o
|
||||
ifdef CONFIG_VNC_THREAD
|
||||
vnc-obj-y += vnc-jobs-async.o
|
||||
else
|
||||
|
|
|
@ -56,7 +56,7 @@ typedef struct coreaudioVoiceOut {
|
|||
|
||||
static void coreaudio_logstatus (OSStatus status)
|
||||
{
|
||||
char *str = "BUG";
|
||||
const char *str = "BUG";
|
||||
|
||||
switch(status) {
|
||||
case kAudioHardwareNoError:
|
||||
|
|
|
@ -2473,7 +2473,13 @@ fi
|
|||
fdatasync=no
|
||||
cat > $TMPC << EOF
|
||||
#include <unistd.h>
|
||||
int main(void) { return fdatasync(0); }
|
||||
int main(void) {
|
||||
#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
|
||||
return fdatasync(0);
|
||||
#else
|
||||
#abort Not supported
|
||||
#endif
|
||||
}
|
||||
EOF
|
||||
if compile_prog "" "" ; then
|
||||
fdatasync=yes
|
||||
|
|
|
@ -19,13 +19,9 @@
|
|||
#ifndef _LIBFDT_ENV_H
|
||||
#define _LIBFDT_ENV_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
#include "bswap.h"
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
#ifdef HOST_WORDS_BIGENDIAN
|
||||
#define fdt32_to_cpu(x) (x)
|
||||
#define cpu_to_fdt32(x) (x)
|
||||
#define fdt64_to_cpu(x) (x)
|
||||
|
|
1
osdep.h
1
osdep.h
|
@ -88,6 +88,7 @@
|
|||
# define QEMU_GNUC_PREREQ(maj, min) 0
|
||||
#endif
|
||||
|
||||
int qemu_daemon(int nochdir, int noclose);
|
||||
void *qemu_memalign(size_t alignment, size_t size);
|
||||
void *qemu_vmalloc(size_t size);
|
||||
void qemu_vfree(void *ptr);
|
||||
|
|
|
@ -26,11 +26,27 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* The following block of code temporarily renames the daemon() function so the
|
||||
compiler does not see the warning associated with it in stdlib.h on OSX */
|
||||
#ifdef __APPLE__
|
||||
#define daemon qemu_fake_daemon_function
|
||||
#include <stdlib.h>
|
||||
#undef daemon
|
||||
extern int daemon(int, int);
|
||||
#endif
|
||||
|
||||
#include "config-host.h"
|
||||
#include "sysemu.h"
|
||||
#include "trace.h"
|
||||
#include "qemu_socket.h"
|
||||
|
||||
|
||||
|
||||
int qemu_daemon(int nochdir, int noclose)
|
||||
{
|
||||
return daemon(nochdir, noclose);
|
||||
}
|
||||
|
||||
void *qemu_oom_check(void *ptr)
|
||||
{
|
||||
if (ptr == NULL) {
|
||||
|
|
|
@ -132,6 +132,11 @@ static inline char *realpath(const char *path, char *resolved_path)
|
|||
|
||||
#endif /* !defined(NEED_CPU_H) */
|
||||
|
||||
/* main function, renamed */
|
||||
#if defined(CONFIG_COCOA)
|
||||
int qemu_main(int argc, char **argv, char **envp);
|
||||
#endif
|
||||
|
||||
/* bottom halves */
|
||||
typedef void QEMUBHFunc(void *opaque);
|
||||
|
||||
|
|
|
@ -359,7 +359,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if (!verbose) {
|
||||
/* detach client and server */
|
||||
if (daemon(0, 0) == -1) {
|
||||
if (qemu_daemon(0, 0) == -1) {
|
||||
err(EXIT_FAILURE, "Failed to daemonize");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1132,7 +1132,7 @@ static void gen_intermediate_code_internal(CPUState *env,
|
|||
if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
|
||||
qemu_log("\n");
|
||||
log_target_disas(pc_start, dc->pc - pc_start, 0);
|
||||
qemu_log("\nisize=%d osize=%zd\n",
|
||||
qemu_log("\nisize=%d osize=%td\n",
|
||||
dc->pc - pc_start, gen_opc_ptr - gen_opc_buf);
|
||||
}
|
||||
#endif
|
||||
|
|
25
ui/cocoa.m
25
ui/cocoa.m
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include <crt_externs.h>
|
||||
|
||||
#include "qemu-common.h"
|
||||
#include "console.h"
|
||||
|
@ -61,9 +62,7 @@
|
|||
int bitsPerPixel;
|
||||
} QEMUScreen;
|
||||
|
||||
int qemu_main(int argc, char **argv); // main defined in qemu/vl.c
|
||||
NSWindow *normalWindow;
|
||||
id cocoaView;
|
||||
static DisplayChangeListener *dcl;
|
||||
|
||||
int gArgc;
|
||||
|
@ -278,6 +277,8 @@ - (float) cdy;
|
|||
- (QEMUScreen) gscreen;
|
||||
@end
|
||||
|
||||
QemuCocoaView *cocoaView;
|
||||
|
||||
@implementation QemuCocoaView
|
||||
- (id)initWithFrame:(NSRect)frameRect
|
||||
{
|
||||
|
@ -794,7 +795,7 @@ - (void)startEmulationWithArgc:(int)argc argv:(char**)argv
|
|||
COCOA_DEBUG("QemuCocoaAppController: startEmulationWithArgc\n");
|
||||
|
||||
int status;
|
||||
status = qemu_main(argc, argv);
|
||||
status = qemu_main(argc, argv, *_NSGetEnviron());
|
||||
exit(status);
|
||||
}
|
||||
|
||||
|
@ -865,10 +866,20 @@ int main (int argc, const char * argv[]) {
|
|||
|
||||
/* In case we don't need to display a window, let's not do that */
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "-vnc") ||
|
||||
!strcmp(argv[i], "-nographic") ||
|
||||
!strcmp(argv[i], "-curses")) {
|
||||
return qemu_main(gArgc, gArgv);
|
||||
const char *opt = argv[i];
|
||||
|
||||
if (opt[0] == '-') {
|
||||
/* Treat --foo the same as -foo. */
|
||||
if (opt[1] == '-') {
|
||||
opt++;
|
||||
}
|
||||
if (!strcmp(opt, "-h") || !strcmp(opt, "-help") ||
|
||||
!strcmp(opt, "-vnc") ||
|
||||
!strcmp(opt, "-nographic") ||
|
||||
!strcmp(opt, "-version") ||
|
||||
!strcmp(opt, "-curses")) {
|
||||
return qemu_main(gArgc, gArgv, *_NSGetEnviron());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue