Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeapostrophe/a3079e69f3a5254b97d815443e507d1b to your computer and use it in GitHub Desktop.
Save jeapostrophe/a3079e69f3a5254b97d815443e507d1b to your computer and use it in GitHub Desktop.
From 6cc6aeb987cf426af1e2bfe28d7135abb40a4745 Mon Sep 17 00:00:00 2001
From: Jay McCarthy <jay.mccarthy@gmail.com>
Date: Thu, 7 Jul 2016 22:40:59 -0400
Subject: [PATCH 1/1] Updating to work with OS X 10.11.4 and XCode 7.3.1, plus
adding convenience top-level Makefile
---
GNUmakefile | 5 +++++
higan/audio/audio.cpp | 6 +++++-
higan/out/.gitignore | 5 +++--
hiro/cocoa/window.cpp | 4 ++--
icarus/GNUmakefile | 2 +-
icarus/out/.gitignore | 3 ++-
ruby/ruby.cpp | 12 ++++++++++--
ruby/video/cgl.cpp | 2 +-
8 files changed, 29 insertions(+), 10 deletions(-)
create mode 100644 GNUmakefile
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..db55a62
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,5 @@
+.PHONY: all
+
+all:
+ $(MAKE) -C higan
+ $(MAKE) -C icarus
diff --git a/higan/audio/audio.cpp b/higan/audio/audio.cpp
index 8404ced..c4bbe95 100644
--- a/higan/audio/audio.cpp
+++ b/higan/audio/audio.cpp
@@ -54,7 +54,11 @@ auto Audio::process() -> void {
if(!stream->pending()) return;
}
- double samples[channels] = {0};
+ double samples[channels];
+ for(auto c : range(channels)) {
+ samples[c] = 0.0;
+ }
+
for(auto& stream : streams) {
double buffer[16];
uint length = stream->read(buffer), offset = 0;
diff --git a/higan/out/.gitignore b/higan/out/.gitignore
index 827a1ea..725140a 100644
--- a/higan/out/.gitignore
+++ b/higan/out/.gitignore
@@ -1,2 +1,3 @@
-higan
-tomoko
+/higan
+/tomoko
+/higan.app
diff --git a/hiro/cocoa/window.cpp b/hiro/cocoa/window.cpp
index 128b317..6b4d459 100644
--- a/hiro/cocoa/window.cpp
+++ b/hiro/cocoa/window.cpp
@@ -38,7 +38,7 @@
[item setTarget:self];
[rootMenu addItem:item];
- string result = nall::execute("defaults", "read", "/Library/Preferences/com.apple.security", "GKAutoRearm").strip();
+ string result = nall::execute("defaults", "read", "/Library/Preferences/com.apple.security", "GKAutoRearm").output.strip();
if(result != "0") {
disableGatekeeperAutoRearm = [[[NSMenuItem alloc] initWithTitle:@"Disable Gatekeeper Auto-Rearm" action:@selector(menuDisableGatekeeperAutoRearm) keyEquivalent:@""] autorelease];
[disableGatekeeperAutoRearm setTarget:self];
@@ -144,7 +144,7 @@
[alert setMessageText:@"Disable Gatekeeper Auto-Rearm"];
nall::execute("sudo", "defaults", "write", "/Library/Preferences/com.apple.security", "GKAutoRearm", "-bool", "NO");
- if(nall::execute("defaults", "read", "/Library/Preferences/com.apple.security", "GKAutoRearm").strip() == "0") {
+ if(nall::execute("defaults", "read", "/Library/Preferences/com.apple.security", "GKAutoRearm").output.strip() == "0") {
[alert setAlertStyle:NSInformationalAlertStyle];
[alert setInformativeText:@"Gatekeeper's automatic 30-day rearm behavior has been disabled successfully."];
[disableGatekeeperAutoRearm setHidden:YES];
diff --git a/icarus/GNUmakefile b/icarus/GNUmakefile
index fc201db..9d014e0 100644
--- a/icarus/GNUmakefile
+++ b/icarus/GNUmakefile
@@ -14,7 +14,7 @@ objects += obj/icarus.o
objects += $(if $(call streq,$(platform),windows),obj/resource.o)
all: $(objects)
- $(call unique,$(compiler) -o out/$(name) $(objects) $(link) $(hirolink))
+ $(compiler) -o out/$(name) $(call unique,$(objects)) $(link) $(hirolink)
ifeq ($(platform),macosx)
@if [ -d out/$(name).app ]; then rm -r out/$(name).app; fi
mkdir -p out/$(name).app/Contents/MacOS/
diff --git a/icarus/out/.gitignore b/icarus/out/.gitignore
index 094b84a..d146817 100644
--- a/icarus/out/.gitignore
+++ b/icarus/out/.gitignore
@@ -1 +1,2 @@
-icarus
+/icarus
+/icarus.app
diff --git a/ruby/ruby.cpp b/ruby/ruby.cpp
index a54cd2f..08d3acc 100644
--- a/ruby/ruby.cpp
+++ b/ruby/ruby.cpp
@@ -18,12 +18,20 @@ using namespace ruby;
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#elif defined(DISPLAY_QUARTZ)
- #define Boolean CocoaBoolean
- #define decimal CocoaDecimal
+ #define Boolean Cocoa_Boolean
+ #define decimal Cocoa_Decimal
+ #define uint64 Cocoa_uint64
+ #define uint32 Cocoa_uint32
+ #define uint16 Cocoa_uint16
+ #define uint8 Cocoa_uint8
#include <Cocoa/Cocoa.h>
#include <Carbon/Carbon.h>
#undef Boolean
#undef decimal
+ #undef uint64
+ #undef uint32
+ #undef uint16
+ #undef uint8
#elif defined(DISPLAY_WINDOWS)
#include <windows.h>
#endif
diff --git a/ruby/video/cgl.cpp b/ruby/video/cgl.cpp
index 640c3d7..b51212a 100644
--- a/ruby/video/cgl.cpp
+++ b/ruby/video/cgl.cpp
@@ -78,7 +78,7 @@ struct VideoCGL : Video, OpenGL {
return false;
}
- auto lock(uint32*& data, uint& pitch, uint width, uint height) -> bool {
+ auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
OpenGL::size(width, height);
return OpenGL::lock(data, pitch);
}
--
2.9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment