]> git.proxmox.com Git - mirror_qemu.git/blobdiff - util/qemu-timer-common.c
hw/s390x/3270-ccw: avoid taking address of fields in packed struct
[mirror_qemu.git] / util / qemu-timer-common.c
index 16f5e758b21f642b02273f41735c147a83561b75..06d084d3646aa693136b28b339e1df2bda046eb1 100644 (file)
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu/timer.h"
 
 /***********************************************************/
@@ -49,9 +50,7 @@ int use_rt_clock;
 static void __attribute__((constructor)) init_get_clock(void)
 {
     use_rt_clock = 0;
-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \
-    || defined(__DragonFly__) || defined(__FreeBSD_kernel__) \
-    || defined(__OpenBSD__)
+#ifdef CLOCK_MONOTONIC
     {
         struct timespec ts;
         if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {