fix builds on osx 10.4
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
IoIxD 2026-04-13 13:46:25 -07:00
commit 728983b92c
5 changed files with 30 additions and 15 deletions

4
configure vendored
View file

@ -38,7 +38,6 @@ require("./pl/utils.pl");
param_set("classic-theme", 0); param_set("classic-theme", 0);
param_set("stb-image", 1); param_set("stb-image", 1);
param_set("stb-truetype", 0);
param_set("xrender", 1); param_set("xrender", 1);
param_set("opengl", 0); param_set("opengl", 0);
param_set("vulkan", 0); param_set("vulkan", 0);
@ -50,6 +49,9 @@ param_set("examples", 1);
if($target ne "Darwin") { if($target ne "Darwin") {
param_set("freetype2", 1); param_set("freetype2", 1);
param_set("stb-truetype", 0);
} else {
param_set("stb-truetype", 1);
} }
my %features = ( my %features = (

View file

@ -86,18 +86,17 @@
@end @end
@interface MilskoCocoaView : NSView { @interface MilskoCocoaView : NSView {
NSBitmapImageRep* rep; NSBitmapImageRep* rep;
NSGraphicsContext* context; NSGraphicsContext* context;
MwBool valid; MwBool valid;
CGColorSpaceRef space; CGColorSpaceRef space;
CGDataProviderRef provider; CGDataProviderRef provider;
NSRect givenRect; NSRect givenRect;
float x; float x;
float y; float y;
float width; float width;
float height; float height;
MwBool _child; MwBool _child;
IBOutlet NSViewController* viewController;
} }
- (void)initRepAndContextWithWidth:(float)w Height:(float)h; - (void)initRepAndContextWithWidth:(float)w Height:(float)h;

View file

@ -57,17 +57,26 @@
#define M_PI 3.14159265 #define M_PI 3.14159265
#endif #endif
/* Windows */
#if defined(_MILSKO) && defined(_WIN32) #if defined(_MILSKO) && defined(_WIN32)
#define MWDECL extern __declspec(dllexport) #define MWDECL extern __declspec(dllexport)
#elif defined(_WIN32) #elif defined(_WIN32)
#define MWDECL extern __declspec(dllimport) #define MWDECL extern __declspec(dllimport)
/* GCC/Clang */
/* First check if we have __has_attribute and can check for the existence of visibility */
#elif defined(__has_attribute) #elif defined(__has_attribute)
#if __has_attribute(visibility) #if __has_attribute(visibility)
#define MWDECL extern __attribute__((visibility("default"))) #define MWDECL extern __attribute__((visibility("default")))
#else #else
#define MWDECL extern #define MWDECL extern
#endif #endif
/* It might be that we're on an old version of GCC (like the one Apple ships with older versions of Mac OS).
* If we're on gcc 3 or above, assume it's there
*/
#elif __GNUC__ >= 3
#define MWDECL extern __attribute__((visibility("default")))
#else #else
/* all else fails */
#define MWDECL extern #define MWDECL extern
#endif #endif

View file

@ -55,6 +55,7 @@ sub new_object {
my @l = glob($_[0]); my @l = glob($_[0]);
foreach my $e (@l) { foreach my $e (@l) {
$e =~ s/\.(c|m)$/$object_suffix/; $e =~ s/\.(c|m)$/$object_suffix/;
print($e."\n");
push(@library_targets, $e); push(@library_targets, $e);
} }
} }

View file

@ -665,6 +665,9 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) {
NSSize sz = [self->rep size]; NSSize sz = [self->rep size];
MwLL ll = [((MilskoFakePointer*)[[[[self window] contentView] subviews] MwLL ll = [((MilskoFakePointer*)[[[[self window] contentView] subviews]
objectAtIndex:0]) pointer]; objectAtIndex:0]) pointer];
NSRect bounds;
NSArray* subviews = [self subviews];
int i;
[super drawRect:dirtyRect]; [super drawRect:dirtyRect];
if(!self->rep) { if(!self->rep) {
@ -683,8 +686,9 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) {
[self->rep drawInRect:dirtyRect]; [self->rep drawInRect:dirtyRect];
for(NSView* subview in [self subviews]) { for(i = 0; i < [subviews count]; i++) {
NSRect bounds = [subview bounds]; NSView* subview = [subviews objectAtIndex:i];
bounds = [subview bounds];
[subview drawRect:bounds]; [subview drawRect:bounds];
} }