Skip to content

Commit 888ffa4

Browse files
authored
fix prepoc dir for compilation on mac silicon - autogen, cmake, build.command (#1688)
Co-authored-by: vats004 <=>
1 parent 3851d24 commit 888ffa4

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

docs/COMPILATION.MD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Dependencies can be installed via Homebrew as:
133133
```bash
134134
brew install pkg-config
135135
brew install autoconf automake libtool
136+
brew install cmake gpac
136137
# optional if you want OCR:
137138
brew install tesseract
138139
brew install leptonica

src/thirdparty/libpng/pngpriv.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,35 +506,41 @@
506506
# define png_aligncastconst(type, value) ((const void*)(value))
507507
#endif /* __cplusplus */
508508

509-
#if defined(PNG_FLOATING_POINT_SUPPORTED) ||\
510-
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
509+
#if defined(PNG_FLOATING_POINT_SUPPORTED) || defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
511510
/* png.c requires the following ANSI-C constants if the conversion of
512511
* floating point to ASCII is implemented therein:
513512
*
514513
* DBL_DIG Maximum number of decimal digits (can be set to any constant)
515514
* DBL_MIN Smallest normalized fp number (can be set to an arbitrary value)
516515
* DBL_MAX Maximum floating point number (can be set to an arbitrary value)
517516
*/
517+
518518
# include <float.h>
519519

520-
# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
521-
defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
520+
/* Handle floating-point headers depending on the platform */
521+
# if ((defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
522+
defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)) && \
523+
!(defined(__APPLE__) && defined(__MACH__)) // this if block gets executed for older macOS versions
522524
/* We need to check that <math.h> hasn't already been included earlier
523525
* as it seems it doesn't agree with <fp.h>, yet we should really use
524526
* <fp.h> if possible.
525527
*/
526528
# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
527529
# include <fp.h>
528530
# endif
529-
# else
531+
# else // this if block gets executed for newer macOS versions(Ventura/Sonoma/Sequoia) OR other platforms
532+
/* if (defined(__APPLE__) && defined(__MACH__)) or other cases */
533+
/* Include math.h for macOS and all other platforms */
530534
# include <math.h>
531535
# endif
536+
532537
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
533538
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
534539
* MATH=68881
535540
*/
536541
# include <m68881.h>
537542
# endif
543+
538544
#endif
539545

540546
/* This provides the non-ANSI (far) memory allocation routines. */

src/thirdparty/zlib/zutil.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
130130
# endif
131131
#endif
132132

133-
#if defined(MACOS) || defined(TARGET_OS_MAC)
133+
#if defined(MACOS) // for older macOS
134134
# define OS_CODE 7
135135
# ifndef Z_SOLO
136136
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
@@ -141,6 +141,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
141141
# endif
142142
# endif
143143
# endif
144+
#elif defined(__MACH__) && defined(__APPLE__) && defined(TARGET_OS_MAC) // for newer macOS(Ventura/Sonoma/Sequoia)
145+
// do nothing because fdopen is defined already by XCode command-line-tools in these macOS versions
144146
#endif
145147

146148
#ifdef __acorn

0 commit comments

Comments
 (0)