Skip to content

Commit

Permalink
Fix MSVC warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Dec 20, 2023
1 parent 37337d9 commit 24a6ff1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/SFML/Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
////////////////////////////////////////////////////////////
#include <stdio.h>

// this macro avoids the C4127 warning on VC++ ("conditional expression is constant")
#define ASSERT_FALSE (__LINE__ == -1)

#ifndef NDEBUG

#define CSFML_CHECK(object_) \
Expand All @@ -44,7 +41,7 @@
return; \
} \
} \
while (ASSERT_FALSE)
while (0)

#define CSFML_CALL(object_, function_) \
do \
Expand All @@ -58,7 +55,7 @@
fprintf(stderr, "SFML warning: trying to use a null " #object_ " object\n"); \
} \
} \
while (ASSERT_FALSE)
while (0)

#define CSFML_CALL_PTR(object_, function_) \
do \
Expand All @@ -72,7 +69,7 @@
fprintf(stderr, "SFML warning: trying to use a null " #object_ " object\n"); \
} \
} \
while (ASSERT_FALSE)
while (0)

#define CSFML_CHECK_RETURN(object_, default_) \
do \
Expand All @@ -83,7 +80,7 @@
return default_; \
} \
} \
while (ASSERT_FALSE)
while (0)

#define CSFML_CALL_RETURN(object_, function_, default_) \
if (object_) \
Expand Down

0 comments on commit 24a6ff1

Please sign in to comment.