qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 26/32] include: move os_*() to os-foo.h


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 26/32] include: move os_*() to os-foo.h
Date: Wed, 23 Mar 2022 22:11:57 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 23/3/22 16:57, marcandre.lureau@redhat.com wrote:
From: Marc-André Lureau <marcandre.lureau@redhat.com>

For consistency with other os_ functions that do not have POSIX
implementation, declare an inline function for the stub in os-win32.h.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
  include/qemu-common.h     | 4 ----
  include/sysemu/os-posix.h | 2 ++
  include/sysemu/os-win32.h | 4 +++-
  os-win32.c                | 9 ---------
  4 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index 1fbc20e4bcf7..a271cac66a1b 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -24,10 +24,6 @@
  int qemu_main(int argc, char **argv, char **envp);
  #endif
-/* OS specific functions */
-void os_setup_early_signal_handling(void);
-int os_parse_cmd_args(int index, const char *optarg);
-
  void page_size_init(void);
#endif
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index dd64fb401dfb..a49c6848ff1a 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -42,7 +42,9 @@
  extern "C" {
  #endif
+int os_parse_cmd_args(int index, const char *optarg);
  void os_set_line_buffering(void);
+void os_setup_early_signal_handling(void);
  void os_set_proc_name(const char *s);
  void os_setup_signal_handling(void);
  void os_daemonize(void);
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index 770752222ae3..c0ba65389986 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -62,8 +62,10 @@ struct tm *localtime_r(const time_t *timep, struct tm 
*result);
  static inline void os_setup_signal_handling(void) {}
  static inline void os_daemonize(void) {}
  static inline void os_setup_post(void) {}
-void os_set_line_buffering(void);
  static inline void os_set_proc_name(const char *dummy) {}
+static inline int os_parse_cmd_args(int index, const char *optarg) { return 
-1; }
+void os_set_line_buffering(void);
+void os_setup_early_signal_handling(void);

By declaring the same prototype in various headers, we risk someone
update only one implementation. Maybe we need a "os-common.h" header?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]