Skip to content

Commit a2eac6e

Browse files
authored
Merge pull request #2356 from Starbuck5/lineintersect-patch
Don't use SDL_ name for our compat layer
2 parents c36788a + 6651f56 commit a2eac6e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src_c/pgcompat_rect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ ComputeOutCodeF(const SDL_FRect *rect, float x, float y)
3636
}
3737

3838
SDL_bool
39-
SDL_IntersectFRectAndLine(SDL_FRect *rect, float *X1, float *Y1, float *X2,
40-
float *Y2)
39+
PG_IntersectFRectAndLine(SDL_FRect *rect, float *X1, float *Y1, float *X2,
40+
float *Y2)
4141
{
4242
float x = 0;
4343
float y = 0;

src_c/pgcompat_rect.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ typedef struct SDL_FPoint {
2020
#if !(SDL_VERSION_ATLEAST(2, 0, 22))
2121

2222
SDL_bool
23-
SDL_IntersectFRectAndLine(SDL_FRect *rect, float *X1, float *Y1, float *X2,
24-
float *Y2);
23+
PG_IntersectFRectAndLine(SDL_FRect *rect, float *X1, float *Y1, float *X2,
24+
float *Y2);
25+
#else
26+
#define PG_IntersectFRectAndLine SDL_IntersectFRectAndLine
2527
#endif /* !(SDL_VERSION_ATLEAST(2, 0, 22)) */
2628

2729
#define pg_PyFloat_FromFloat(x) (PyFloat_FromDouble((double)x))

src_c/rect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ four_floats_from_obj(PyObject *obj, float *val1, float *val2, float *val3,
253253
#define RectImport_twoPrimitivesFromObj pg_TwoFloatsFromObj
254254
#define RectImport_PrimitiveFromObj pg_FloatFromObj
255255
#define RectImport_RectObject pgFRectObject
256-
#define RectImport_IntersectRectAndLine SDL_IntersectFRectAndLine
256+
#define RectImport_IntersectRectAndLine PG_IntersectFRectAndLine
257257
#define RectImport_TypeObject pgFRect_Type
258258
#define RectImport_PyBuildValueFormat "f"
259259
#define RectImport_ObjectName "pygame.rect.FRect"

0 commit comments

Comments
 (0)