Skip to content

Commit 6298716

Browse files
Mr-DaveDevMr-Dave
authored andcommitted
Revise defines for HAVE_STDLIB_H
1 parent 0afea9c commit 6298716

4 files changed

Lines changed: 71 additions & 1 deletion

File tree

jpegutils.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,32 @@
5353
#include "motion.h"
5454
#include "jpegutils.h"
5555
#include <setjmp.h>
56+
57+
58+
/* This is a workaround regarding these defines. The config.h file defines
59+
* HAVE_STDLIB_H as 1 whereas the jpeglib.h just defines it without a value.
60+
* this causes massive warnings/error on mis-matched definitions. We do not
61+
* control either of these so we have to suffer through this workaround hack
62+
*/
63+
#if (HAVE_STDLIB_H == 1)
64+
#undef HAVE_STDLIB_H
65+
#define HAVE_STDLIB_H_ORIG 1
66+
#endif
67+
5668
#include <jpeglib.h>
69+
70+
#ifdef HAVE_STDLIB_H
71+
#ifdef HAVE_STDLIB_H_ORIG
72+
#undef HAVE_STDLIB_H
73+
#undef HAVE_STDLIB_H_ORIG
74+
#define HAVE_STDLIB_H 1
75+
#else
76+
#undef HAVE_STDLIB_H
77+
#endif
78+
#endif
79+
80+
81+
5782
#include <jerror.h>
5883
#include <assert.h>
5984

motion_build.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h4><a name="BUILD_FREEBSD"></a>FreeBSD</a> </h4>
369369
<li>MySQL database functionality</li>
370370
<ul>
371371
<p></p>
372-
<code><strong>sudo pkg install mysql57-client</strong></code>
372+
<code><strong>sudo pkg install mysql57-client openssl</strong></code>
373373
<p></p>
374374
</ul>
375375
<li>PostgreSQL database functionality</li>

netcam.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,29 @@
1515
#ifndef _INCLUDE_NETCAM_H
1616
#define _INCLUDE_NETCAM_H
1717

18+
/* This is a workaround regarding these defines. The config.h file defines
19+
* HAVE_STDLIB_H as 1 whereas the jpeglib.h just defines it without a value.
20+
* this causes massive warnings/error on mis-matched definitions. We do not
21+
* control either of these so we have to suffer through this workaround hack
22+
*/
23+
#if (HAVE_STDLIB_H == 1)
24+
#undef HAVE_STDLIB_H
25+
#define HAVE_STDLIB_H_ORIG 1
26+
#endif
27+
1828
#include <jpeglib.h>
29+
30+
#ifdef HAVE_STDLIB_H
31+
#ifdef HAVE_STDLIB_H_ORIG
32+
#undef HAVE_STDLIB_H
33+
#undef HAVE_STDLIB_H_ORIG
34+
#define HAVE_STDLIB_H 1
35+
#else
36+
#undef HAVE_STDLIB_H
37+
#endif
38+
#endif
39+
40+
1941
#include <setjmp.h>
2042
#include <sys/socket.h>
2143
#include <sys/types.h>

netcam_jpeg.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,30 @@
1313
*/
1414
#include "translate.h"
1515
#include "rotate.h" /* already includes motion.h */
16+
17+
/* This is a workaround regarding these defines. The config.h file defines
18+
* HAVE_STDLIB_H as 1 whereas the jpeglib.h just defines it without a value.
19+
* this causes massive warnings/error on mis-matched definitions. We do not
20+
* control either of these so we have to suffer through this workaround hack
21+
*/
22+
#if (HAVE_STDLIB_H == 1)
23+
#undef HAVE_STDLIB_H
24+
#define HAVE_STDLIB_H_ORIG 1
25+
#endif
26+
1627
#include <jpeglib.h>
28+
29+
#ifdef HAVE_STDLIB_H
30+
#ifdef HAVE_STDLIB_H_ORIG
31+
#undef HAVE_STDLIB_H
32+
#undef HAVE_STDLIB_H_ORIG
33+
#define HAVE_STDLIB_H 1
34+
#else
35+
#undef HAVE_STDLIB_H
36+
#endif
37+
#endif
38+
39+
1740
#include <jerror.h>
1841

1942
/*

0 commit comments

Comments
 (0)