]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
qemuvgaglue.h, slirp.h: trivial changes
authorFrode Solheim <frode@fs-uae.net>
Sat, 5 Sep 2015 08:55:46 +0000 (10:55 +0200)
committerFrode Solheim <frode@fs-uae.net>
Sat, 5 Sep 2015 08:55:46 +0000 (10:55 +0200)
include/uae/inline.h [new file with mode: 0644]
qemuvga/qemuuaeglue.h
slirp/slirp.h

diff --git a/include/uae/inline.h b/include/uae/inline.h
new file mode 100644 (file)
index 0000000..d104c4d
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef UAE_INLINE_H
+#define UAE_INLINE_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+// FIXME: could be named funcattr.h or something, perhaps
+// FIXME: move regparams here?
+
+#if defined(HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE)
+#define UAE_STATIC_INLINE static __inline__ __attribute__ ((always_inline))
+#elif defined(_MSC_VER)
+#define UAE_STATIC_INLINE static __forceinline
+#else
+#define UAE_STATIC_INLINE static inline
+#endif
+
+#if defined(HAVE_FUNC_ATTRIBUTE_NOINLINE)
+#define UAE_NOINLINE __attribute__ ((noinline))
+#elif defined(_MSC_VER)
+#define UAE_NOINLINE __declspec(noinline)
+#else
+#define UAE_NOINLINE
+#endif
+
+#if defined(HAVE_FUNC_ATTRIBUTE_NORETURN)
+#define UAE_NORETURN __attribute__ ((noreturn))
+#elif defined(_MSC_VER)
+#define UAE_NORETURN __declspec(noreturn)
+#else
+#define UAE_NORETURN
+#endif
+
+#ifndef STATIC_INLINE
+#define STATIC_INLINE UAE_STATIC_INLINE
+#endif
+
+#ifndef NOINLINE
+#define NOINLINE UAE_NOINLINE
+#endif
+
+#ifndef NORETURN
+#define NORETURN UAE_NORETURN
+#endif
+
+#endif /* UAE_INLINE_H */
index 9fc9575ce63178b40380291b1e2ff8ab1cfc7642..374c4bd6ac759486f117d92d47085c1630c6c2d7 100644 (file)
@@ -1,5 +1,5 @@
-
-
+#include "uae/inline.h"
+#include "uae/likely.h"
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
@@ -18,14 +18,6 @@ extern void write_log (const char *, ...);
 #define tostring(s)    #s
 #endif
 
-#ifndef likely
-#if __GNUC__ < 3
-#define __builtin_expect(x, n) (x)
-#endif
-#define likely(x)   __builtin_expect(!!(x), 1)
-#define unlikely(x)   __builtin_expect(!!(x), 0)
-#endif
-
 typedef int ssize_t;
 
 #ifdef _MSC_VER
index 3d815c7dde127f9db5e8ebd5b552776236a7b9c6..483384ff7cc112fb8771b173521ff0f04fece485 100644 (file)
@@ -12,7 +12,7 @@
 #include "slirp_config.h"
 
 #ifdef _WIN32
-# include <stdint.h>
+#include <stdint.h>
 
 typedef uint8_t u_int8_t;
 typedef uint16_t u_int16_t;