summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2020-12-23 13:47:49 -0800
committerSam Lantinga <slouken@libsdl.org>2020-12-23 13:47:49 -0800
commit6cfbb62778b1d7b9d651645e06ed41a60d925b17 (patch)
tree9c0cc537d7c2352aac674cb8ed23260789a6c37c /include
parent325c9dcf2fc5376c509ba73d73e39f957adfe509 (diff)
downloadsdl-6cfbb62778b1d7b9d651645e06ed41a60d925b17.tar.gz
Fixed bug 5404 - stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf
Cameron Cawley stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf The default implementation is based on the one used in the Windows RT video driver.
Diffstat (limited to 'include')
-rw-r--r--include/SDL_config.h.cmake4
-rw-r--r--include/SDL_config.h.in4
-rw-r--r--include/SDL_config_android.h4
-rw-r--r--include/SDL_config_iphoneos.h4
-rw-r--r--include/SDL_config_macosx.h4
-rw-r--r--include/SDL_config_os2.h4
-rw-r--r--include/SDL_config_pandora.h4
-rw-r--r--include/SDL_config_windows.h4
-rw-r--r--include/SDL_config_winrt.h4
-rw-r--r--include/SDL_config_wiz.h4
-rw-r--r--include/SDL_stdinc.h4
11 files changed, 44 insertions, 0 deletions
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index 754b57013..e3aae654c 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -166,8 +166,12 @@
#cmakedefine HAVE_LOGF 1
#cmakedefine HAVE_LOG10 1
#cmakedefine HAVE_LOG10F 1
+#cmakedefine HAVE_LROUND 1
+#cmakedefine HAVE_LROUNDF 1
#cmakedefine HAVE_POW 1
#cmakedefine HAVE_POWF 1
+#cmakedefine HAVE_ROUND 1
+#cmakedefine HAVE_ROUNDF 1
#cmakedefine HAVE_SCALBN 1
#cmakedefine HAVE_SCALBNF 1
#cmakedefine HAVE_SIN 1
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index 3a2a7149d..07b94f47f 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -170,8 +170,12 @@
#undef HAVE_LOGF
#undef HAVE_LOG10
#undef HAVE_LOG10F
+#undef HAVE_LROUND
+#undef HAVE_LROUNDF
#undef HAVE_POW
#undef HAVE_POWF
+#undef HAVE_ROUND
+#undef HAVE_ROUNDF
#undef HAVE_SCALBN
#undef HAVE_SCALBNF
#undef HAVE_SIN
diff --git a/include/SDL_config_android.h b/include/SDL_config_android.h
index d1148cf2f..b53096bce 100644
--- a/include/SDL_config_android.h
+++ b/include/SDL_config_android.h
@@ -111,8 +111,12 @@
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h
index f06ad3354..2a8ae5426 100644
--- a/include/SDL_config_iphoneos.h
+++ b/include/SDL_config_iphoneos.h
@@ -112,8 +112,12 @@
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h
index 4b45f1658..e98e3601c 100644
--- a/include/SDL_config_macosx.h
+++ b/include/SDL_config_macosx.h
@@ -115,8 +115,12 @@
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
diff --git a/include/SDL_config_os2.h b/include/SDL_config_os2.h
index 1922217d0..c9e9334ac 100644
--- a/include/SDL_config_os2.h
+++ b/include/SDL_config_os2.h
@@ -172,8 +172,12 @@
/* #undef HAVE_LOGF */
#define HAVE_LOG10 1
/* #undef HAVE_LOG10F */
+/* #undef HAVE_LROUND */
+/* #undef HAVE_LROUNDF */
#define HAVE_POW 1
/* #undef HAVE_POWF */
+/* #undef HAVE_ROUND */
+/* #undef HAVE_ROUNDF */
#define HAVE_SIN 1
/* #undef HAVE_SINF */
/* #undef HAVE_SCALBN */
diff --git a/include/SDL_config_pandora.h b/include/SDL_config_pandora.h
index 8728a6388..974922e8f 100644
--- a/include/SDL_config_pandora.h
+++ b/include/SDL_config_pandora.h
@@ -95,6 +95,10 @@
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_LOG10 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h
index 18a363829..519014874 100644
--- a/include/SDL_config_windows.h
+++ b/include/SDL_config_windows.h
@@ -173,6 +173,10 @@ typedef unsigned int uintptr_t;
#if _MSC_VER >= 1800
#define HAVE_STRTOLL 1
#define HAVE_VSSCANF 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_TRUNC 1
diff --git a/include/SDL_config_winrt.h b/include/SDL_config_winrt.h
index 02079f53c..2144b79fa 100644
--- a/include/SDL_config_winrt.h
+++ b/include/SDL_config_winrt.h
@@ -172,8 +172,12 @@ typedef unsigned int uintptr_t;
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
#define HAVE__SCALB 1
#define HAVE_SIN 1
#define HAVE_SINF 1
diff --git a/include/SDL_config_wiz.h b/include/SDL_config_wiz.h
index f65af8eb5..3d176fb7c 100644
--- a/include/SDL_config_wiz.h
+++ b/include/SDL_config_wiz.h
@@ -107,8 +107,12 @@
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h
index 91ccaa451..2ada8d69e 100644
--- a/include/SDL_stdinc.h
+++ b/include/SDL_stdinc.h
@@ -549,6 +549,10 @@ extern DECLSPEC double SDLCALL SDL_log10(double x);
extern DECLSPEC float SDLCALL SDL_log10f(float x);
extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
extern DECLSPEC float SDLCALL SDL_powf(float x, float y);
+extern DECLSPEC double SDLCALL SDL_round(double x);
+extern DECLSPEC float SDLCALL SDL_roundf(float x);
+extern DECLSPEC long SDLCALL SDL_lround(double x);
+extern DECLSPEC long SDLCALL SDL_lroundf(float x);
extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n);
extern DECLSPEC double SDLCALL SDL_sin(double x);