]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/libm.h
tls: Use TLSv1_client_method for OpenSSL
[ffmpeg] / libavutil / libm.h
index c9d188b4d9c6431b54310523a7c4d5a08d73ede9..783f3cdfab68cb4021e799ce8cabb960599a16c8 100644 (file)
@@ -1,23 +1,23 @@
 /*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /**
- * @file libavutil/libm.h
+ * @file
  * Replacements for frequently missing libm functions
  */
 
@@ -26,6 +26,7 @@
 
 #include <math.h>
 #include "config.h"
+#include "attributes.h"
 
 #if !HAVE_EXP2
 #undef exp2
 #define llrint(x) ((long long)rint(x))
 #endif /* HAVE_LLRINT */
 
+#if !HAVE_LLRINTF
+#undef llrintf
+#define llrintf(x) ((long long)rint(x))
+#endif /* HAVE_LLRINT */
+
 #if !HAVE_LOG2
 #undef log2
 #define log2(x) (log(x) * 1.44269504088896340736)
@@ -80,6 +86,13 @@ static av_always_inline av_const float roundf(float x)
 }
 #endif /* HAVE_ROUNDF */
 
+#if !HAVE_TRUNC
+static av_always_inline av_const double trunc(double x)
+{
+    return (x > 0) ? floor(x) : ceil(x);
+}
+#endif /* HAVE_TRUNC */
+
 #if !HAVE_TRUNCF
 static av_always_inline av_const float truncf(float x)
 {