From 6298716a56c0110383323ec1dd896e49a61baa15 Mon Sep 17 00:00:00 2001 From: Mr-DaveDev Date: Mon, 22 Oct 2018 21:03:39 -0600 Subject: [PATCH] Revise defines for HAVE_STDLIB_H --- jpegutils.c | 25 +++++++++++++++++++++++++ motion_build.html | 2 +- netcam.h | 22 ++++++++++++++++++++++ netcam_jpeg.c | 23 +++++++++++++++++++++++ 4 files changed, 71 insertions(+), 1 deletion(-) diff --git a/jpegutils.c b/jpegutils.c index fa1a3954..7e3488a0 100644 --- a/jpegutils.c +++ b/jpegutils.c @@ -53,7 +53,32 @@ #include "motion.h" #include "jpegutils.h" #include + + +/* This is a workaround regarding these defines. The config.h file defines + * HAVE_STDLIB_H as 1 whereas the jpeglib.h just defines it without a value. + * this causes massive warnings/error on mis-matched definitions. We do not + * control either of these so we have to suffer through this workaround hack +*/ +#if (HAVE_STDLIB_H == 1) + #undef HAVE_STDLIB_H + #define HAVE_STDLIB_H_ORIG 1 +#endif + #include + +#ifdef HAVE_STDLIB_H + #ifdef HAVE_STDLIB_H_ORIG + #undef HAVE_STDLIB_H + #undef HAVE_STDLIB_H_ORIG + #define HAVE_STDLIB_H 1 + #else + #undef HAVE_STDLIB_H + #endif +#endif + + + #include #include diff --git a/motion_build.html b/motion_build.html index 0d3e1786..44ffd7a2 100644 --- a/motion_build.html +++ b/motion_build.html @@ -369,7 +369,7 @@
  • MySQL database functionality
    • - sudo pkg install mysql57-client + sudo pkg install mysql57-client openssl

  • PostgreSQL database functionality
  • diff --git a/netcam.h b/netcam.h index 5247be5c..2951d917 100644 --- a/netcam.h +++ b/netcam.h @@ -15,7 +15,29 @@ #ifndef _INCLUDE_NETCAM_H #define _INCLUDE_NETCAM_H +/* This is a workaround regarding these defines. The config.h file defines + * HAVE_STDLIB_H as 1 whereas the jpeglib.h just defines it without a value. + * this causes massive warnings/error on mis-matched definitions. We do not + * control either of these so we have to suffer through this workaround hack +*/ +#if (HAVE_STDLIB_H == 1) + #undef HAVE_STDLIB_H + #define HAVE_STDLIB_H_ORIG 1 +#endif + #include + +#ifdef HAVE_STDLIB_H + #ifdef HAVE_STDLIB_H_ORIG + #undef HAVE_STDLIB_H + #undef HAVE_STDLIB_H_ORIG + #define HAVE_STDLIB_H 1 + #else + #undef HAVE_STDLIB_H + #endif +#endif + + #include #include #include diff --git a/netcam_jpeg.c b/netcam_jpeg.c index 5211add7..e6fff5e3 100644 --- a/netcam_jpeg.c +++ b/netcam_jpeg.c @@ -13,7 +13,30 @@ */ #include "translate.h" #include "rotate.h" /* already includes motion.h */ + +/* This is a workaround regarding these defines. The config.h file defines + * HAVE_STDLIB_H as 1 whereas the jpeglib.h just defines it without a value. + * this causes massive warnings/error on mis-matched definitions. We do not + * control either of these so we have to suffer through this workaround hack +*/ +#if (HAVE_STDLIB_H == 1) + #undef HAVE_STDLIB_H + #define HAVE_STDLIB_H_ORIG 1 +#endif + #include + +#ifdef HAVE_STDLIB_H + #ifdef HAVE_STDLIB_H_ORIG + #undef HAVE_STDLIB_H + #undef HAVE_STDLIB_H_ORIG + #define HAVE_STDLIB_H 1 + #else + #undef HAVE_STDLIB_H + #endif +#endif + + #include /*