From 2bddc246ecdecfca0e09bc901c18258d2a3e6ceb Mon Sep 17 00:00:00 2001
From: Travis Geiselbrecht <travisg@google.com>
Date: Mon, 12 Sep 2016 17:42:51 -0700
Subject: [PATCH 1/2] [mac] macs use _ prefixed symbols, fix the font assembly
 files

---
 src/asm.h             | 11 +++++++++++
 src/font-droid-sans.S | 16 ++++++++++------
 src/font-symbols.S    | 14 ++++++++------
 3 files changed, 29 insertions(+), 12 deletions(-)
 create mode 100644 src/asm.h

diff --git a/src/asm.h b/src/asm.h
new file mode 100644
index 0000000..28116ae
--- /dev/null
+++ b/src/asm.h
@@ -0,0 +1,11 @@
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#pragma once
+
+#ifdef __APPLE__
+#define SYM(x) _##x
+#else
+#define SYM(x) x
+#endif
+
diff --git a/src/font-droid-sans.S b/src/font-droid-sans.S
index a4a946e..ac476f2 100644
--- a/src/font-droid-sans.S
+++ b/src/font-droid-sans.S
@@ -2,15 +2,19 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-.global font_droid_sans
-.global size_droid_sans
+#include "asm.h"
+
+.global SYM(font_droid_sans)
+.global SYM(size_droid_sans)
+
+.data
 
 .align 4
-font_droid_sans:
+SYM(font_droid_sans):
 .incbin "../third_party/imgui/extra_fonts/DroidSans.ttf"
-font_droid_sans_end:
+SYM(font_droid_sans_end):
 
 .align 4
-size_droid_sans:
-.int font_droid_sans_end - font_droid_sans
+SYM(size_droid_sans):
+.int SYM(font_droid_sans_end) - SYM(font_droid_sans)
 
diff --git a/src/font-symbols.S b/src/font-symbols.S
index 0084f2d..bd3ada8 100644
--- a/src/font-symbols.S
+++ b/src/font-symbols.S
@@ -2,15 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-.global font_symbols
-.global size_symbols
+#include "asm.h"
+
+.global SYM(font_symbols)
+.global SYM(size_symbols)
 
 .align 4
-font_symbols:
+SYM(font_symbols):
 .incbin "symbols.ttf"
-font_symbols_end:
+SYM(font_symbols_end):
 
 .align 4
-size_symbols:
-.int font_symbols_end - font_symbols
+SYM(size_symbols):
+.int SYM(font_symbols_end) - SYM(font_symbols)
 
-- 
2.9.3

