Work around conflicting declaration of gamma

FossilOrigin-Name: 7c3936be15500a3bdaa3aa603479e02786123f92c9f697b4a420d3b7411aa998
This commit is contained in:
Jonathan Schleifer 2025-03-24 21:11:31 +00:00
parent 45f4039f3b
commit 4596a656dc
3 changed files with 4 additions and 10 deletions

View file

@ -2,9 +2,7 @@
#import <ObjFW/ObjFW.h>
#define gamma gamma__
#include <SDL2/SDL.h>
#undef gamma
#include "tools.h"

View file

@ -1,5 +1,7 @@
// rendergl.cpp: core opengl rendering stuff
#define gamma math_gamma
#include "cube.h"
#import "Command.h"
@ -324,6 +326,8 @@ addstrip(int tex, int start, int n)
[strips addItem:&s];
}
#undef gamma
VARFP(gamma, 30, 100, 300, {
float f = gamma / 100.0f;
Uint16 ramp[256];

View file

@ -3,16 +3,8 @@
#ifndef _TOOLS_H
#define _TOOLS_H
#ifdef __GNUC__
# define gamma __gamma
#endif
#include <math.h>
#ifdef __GNUC__
# undef gamma
#endif
#include <assert.h>
#include <limits.h>
#include <stdarg.h>