Fix compiling with GCC

FossilOrigin-Name: fdcd2b845f71be2cdb790cc3bc3ce2ed4a6f85bb491a602f18025c45e89bdd3b
This commit is contained in:
Jonathan Schleifer 2023-01-07 20:09:20 +00:00
parent 6ed1bf1eff
commit 928dbbc6a8
4 changed files with 14 additions and 3 deletions

View file

@ -32,6 +32,17 @@ LDFLAGS="$LDFLAGS $($OBJFW_CONFIG $OBJFW_CONFIG_FLAGS --ldflags)"
FRAMEWORK_LIBS="$($OBJFW_CONFIG $OBJFW_CONFIG_FLAGS --framework-libs) $LIBS" FRAMEWORK_LIBS="$($OBJFW_CONFIG $OBJFW_CONFIG_FLAGS --framework-libs) $LIBS"
LIBS="$($OBJFW_CONFIG $OBJFW_CONFIG_FLAGS --libs --rpath) $LIBS" LIBS="$($OBJFW_CONFIG $OBJFW_CONFIG_FLAGS --libs --rpath) $LIBS"
AX_CHECK_COMPILER_FLAGS(-std=gnu11, [
OBJCFLAGS="$OBJCFLAGS -std=gnu11"
], [
AX_CHECK_COMPILER_FLAGS(-std=gnu1x, [
OBJCFLAGS="$OBJCFLAGS -std=gnu1x"
], [
AX_CHECK_COMPILER_FLAGS(-std=gnu99,
[OBJCFLAGS="$OBJCFLAGS -std=gnu99"])
])
])
AX_CHECK_COMPILER_FLAGS(-Wdocumentation, AX_CHECK_COMPILER_FLAGS(-Wdocumentation,
[OBJCFLAGS="$OBJCFLAGS -Wdocumentation"]) [OBJCFLAGS="$OBJCFLAGS -Wdocumentation"])

View file

@ -31,7 +31,8 @@
self = [super init]; self = [super init];
@try { @try {
_renderer = [[renderer alloc] initWithOptions: options]; _renderer = [(id <O3DRenderer>)[(Class)renderer alloc]
initWithOptions: options];
} @catch (id e) { } @catch (id e) {
[self release]; [self release];
@throw e; @throw e;

View file

@ -293,7 +293,7 @@ floatToScreenRefresh(float refresh)
hWnd = (FxU32)_winAPIWindow.hWnd; hWnd = (FxU32)_winAPIWindow.hWnd;
#endif #endif
if ((_context = grSstWinOpen(hWnd, screenRefresh, screenRefresh, if ((_context = grSstWinOpen(hWnd, screenResolution, screenRefresh,
GR_COLORFORMAT_RGBA, GR_ORIGIN_LOWER_LEFT, 2, 1)) == 0) GR_COLORFORMAT_RGBA, GR_ORIGIN_LOWER_LEFT, 2, 1)) == 0)
@throw [OFInitializationFailedException @throw [OFInitializationFailedException
exceptionWithClass: self.class]; exceptionWithClass: self.class];

View file

@ -23,7 +23,6 @@ typedef OFPair OF_GENERIC(OFValue *, OFNumber *) *O3DResolution;
@property (readonly, nonatomic) OFArray OF_GENERIC(OFPair OF_GENERIC(OFValue *, @property (readonly, nonatomic) OFArray OF_GENERIC(OFPair OF_GENERIC(OFValue *,
OFNumber *) *) *availableResolutions; OFNumber *) *) *availableResolutions;
+ (instancetype)alloc;
- (instancetype)initWithOptions: - (instancetype)initWithOptions:
(nullable OFDictionary OF_GENERIC(OFString *, id) *)options; (nullable OFDictionary OF_GENERIC(OFString *, id) *)options;
- (void)createWithResolution: (O3DResolution)resolution; - (void)createWithResolution: (O3DResolution)resolution;