Fix mac build

Small fix for mac build: apple's gcc doesn't comprehend __attribute__((hot))

Change-Id: I2cab22e5bfdc1d22027b12d8103bd56cb407a609
diff --git a/src/base/macros.h b/src/base/macros.h
index 8579872..26f3046 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -136,6 +136,12 @@
 #define ALWAYS_INLINE  __attribute__ ((always_inline))
 #endif
 
+#if defined (__APPLE__)
+  #define HOT_ATTR
+#else
+  #define HOT_ATTR __attribute__ ((hot))
+#endif
+
 // bionic and glibc both have TEMP_FAILURE_RETRY, but Mac OS' libc doesn't.
 #ifndef TEMP_FAILURE_RETRY
 #define TEMP_FAILURE_RETRY(exp) ({ \
diff --git a/src/oat/runtime/oat_support_entrypoints.h b/src/oat/runtime/oat_support_entrypoints.h
index 72d5348..75c9378 100644
--- a/src/oat/runtime/oat_support_entrypoints.h
+++ b/src/oat/runtime/oat_support_entrypoints.h
@@ -131,24 +131,25 @@
   void (*pThrowStackOverflowFromCode)(void*);
 };
 
+
 // JNI entrypoints.
 extern uint32_t JniMethodStart(Thread* self)
-    UNLOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+    UNLOCK_FUNCTION(Locks::mutator_lock_) HOT_ATTR;
 extern uint32_t JniMethodStartSynchronized(jobject to_lock, Thread* self)
-    UNLOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+    UNLOCK_FUNCTION(Locks::mutator_lock_) HOT_ATTR;
 extern void JniMethodEnd(uint32_t saved_local_ref_cookie, Thread* self)
-    SHARED_LOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+    SHARED_LOCK_FUNCTION(Locks::mutator_lock_) HOT_ATTR;
 extern void JniMethodEndSynchronized(uint32_t saved_local_ref_cookie, jobject locked,
                                      Thread* self)
-    SHARED_LOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+    SHARED_LOCK_FUNCTION(Locks::mutator_lock_) HOT_ATTR;
 extern mirror::Object* JniMethodEndWithReference(jobject result, uint32_t saved_local_ref_cookie,
                                                  Thread* self)
-    SHARED_LOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+    SHARED_LOCK_FUNCTION(Locks::mutator_lock_) HOT_ATTR;
 
 extern mirror::Object* JniMethodEndWithReferenceSynchronized(jobject result,
                                                              uint32_t saved_local_ref_cookie,
                                                              jobject locked, Thread* self)
-    SHARED_LOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+    SHARED_LOCK_FUNCTION(Locks::mutator_lock_) HOT_ATTR;
 
 // Initialize an entry point data structure.
 void InitEntryPoints(EntryPoints* points);