Advertisement
devinteske

mhxd Sonoma patch

Mar 11th, 2024
1,309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.14 KB | None | 0 0
  1. diff --git a/config.h.in b/config.h.in
  2. index ef62766..f21295d 100644
  3. --- a/config.h.in
  4. +++ b/config.h.in
  5. @@ -177,6 +177,9 @@
  6.  /* Define to 1 if you have the <string.h> header file. */
  7.  #undef HAVE_STRING_H
  8.  
  9. +/* strlcpy */
  10. +#undef HAVE_STRLCPY
  11. +
  12.  /* strptime */
  13.  #undef HAVE_STRPTIME
  14.  
  15. diff --git a/configure b/configure
  16. index 9354bbd..1563778 100755
  17. --- a/configure
  18. +++ b/configure
  19. @@ -25136,7 +25136,11 @@ fi
  20.  echo "$as_me:$LINENO: result: $ac_cv_func_strlcpy" >&5
  21.  echo "${ECHO_T}$ac_cv_func_strlcpy" >&6
  22.  if test $ac_cv_func_strlcpy = yes; then
  23. -  :
  24. +
  25. +cat >>confdefs.h <<\_ACEOF
  26. +#define HAVE_STRLCPY 1
  27. +_ACEOF
  28. +
  29.  else
  30.    aclo_strlcpy=yes;
  31.          HXDLIBLDADD="$HXDLIBLDADD ../lib/strlcpy.o";
  32. diff --git a/configure.in b/configure.in
  33. index 5bca77e..5d124cb 100644
  34. --- a/configure.in
  35. +++ b/configure.in
  36. @@ -768,7 +768,8 @@ if test "$ac_cv_coreservices" = "yes"; then
  37.     HXLDFLAGS="$HXLDFLAGS -framework coreservices"
  38.  fi
  39.  
  40. -AC_CHECK_FUNC(strlcpy, , aclo_strlcpy=yes;
  41. +AC_CHECK_FUNC(strlcpy, AC_DEFINE(HAVE_STRLCPY, 1, [strlcpy]),
  42. +        aclo_strlcpy=yes;
  43.          HXDLIBLDADD="$HXDLIBLDADD ../lib/strlcpy.o";
  44.          HXTRACKDLIBLDADD="$HXTRACKDLIBLDADD ../lib/strlcpy.o";
  45.          HXLIBLDADD="$HXLIBLDADD ../lib/strlcpy.o")
  46. diff --git a/src/apple/api.h b/src/apple/api.h
  47. index 62eb52c..a25ea0d 100644
  48. --- a/src/apple/api.h
  49. +++ b/src/apple/api.h
  50. @@ -12,6 +12,26 @@
  51.  
  52.  /* system includes */
  53.  #ifdef HAVE_CORESERVICES
  54. +/*
  55. + * Mac OS X 14 (Sonoma) has vector-literal compile-time errors.  Avoid
  56. + * including all of CoreServices and instead piece-meal include elements
  57. + * directly from CarbonCore framework.
  58. + *
  59. + * However, it seems Sonoma did not bump __MAC_OS_X_VERSION_MIN_REQUIRED
  60. + * and while it should be something like 140000+ in Mac OS X 14.0+, what I am
  61. + * observing is that Mac OS X 14.3 (for example) thinks it is 13.1.
  62. + *
  63. + * We'll just have to piece-meal include on any Mac OS X later than 13.0 while
  64. + * continuing to perform legacy whole-framework inclusion on 13.1+.
  65. + */
  66. +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_13_1
  67.  #include <CoreServices/CoreServices.h>
  68. +#else
  69. +#include <MacTypes.h>
  70. +#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/Files.h>
  71. +#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/Aliases.h>
  72. +#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/Resources.h>
  73. +#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h>
  74. +#endif
  75.  #endif
  76.  
  77. diff --git a/src/common/hxd.c b/src/common/hxd.c
  78. index 726b03b..273a2c0 100644
  79. --- a/src/common/hxd.c
  80. +++ b/src/common/hxd.c
  81. @@ -106,7 +106,7 @@ inaddr2str (char abuf[HOSTLEN+1], struct SOCKADDR_IN *sa)
  82.  #ifdef CONFIG_IPV6
  83.     inet_ntop(AFINET, (char *)&sa->SIN_ADDR, abuf, HOSTLEN+1);
  84.  #else
  85. -   inet_ntoa(sa->SIN_ADDR, abuf, 16);
  86. +   inet_ntoa_r(sa->SIN_ADDR, abuf, 16);
  87.  #endif
  88.  }
  89.  
  90. diff --git a/src/hxd/htxf.c b/src/hxd/htxf.c
  91. index 52db133..b6f9a2a 100644
  92. --- a/src/hxd/htxf.c
  93. +++ b/src/hxd/htxf.c
  94. @@ -16,6 +16,9 @@
  95.  #if defined(CONFIG_HFS)
  96.  #include "hfs.h"
  97.  #endif
  98. +#if defined(HAVE_CORESERVICES)
  99. +#include "apple/alias.h"
  100. +#endif
  101.  #include "threads.h"
  102.  
  103.  #define HTXF_BUFSIZE       0xf000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement