[MacPorts] #69159: spice-server @0.15.2: error: expected identifier or '('

MacPorts noreply at macports.org
Tue Jan 23 15:25:04 UTC 2024


#69159: spice-server @0.15.2: error: expected identifier or '('
-------------------------------------------------+-------------------------
  Reporter:  leeeoooooo                          |      Owner:  (none)
      Type:  defect                              |     Status:  new
  Priority:  Normal                              |  Milestone:
 Component:  ports                               |    Version:  2.8.1
Resolution:                                      |   Keywords:  i386
      Port:  spice-server, macports-libcxx,      |  snowleopard
  clang-11, clang-10, clang-9.0                  |
-------------------------------------------------+-------------------------
Changes (by ryandesign):

 * cc: jeremyhu (added)
 * port:  spice-server => spice-server, macports-libcxx, clang-11, clang-10,
     clang-9.0


Comment:

 /opt/local/include/libcxx/v1/math.h is provided by the macports-libcxx
 port. math.h is supposed to be a C header. The port also helpfully
 installs a math.h.orig file that helps us see that originally math.h
 didn't contain the problematic line—which is `extern "C" {`, since that
 line can only be used in C++ code.

 The macports-libcxx port copies its files from the clang-11 port. The
 problematic changes are added to the math.h header by this patch:

 source:macports-ports/lang/llvm-11/files/3001-Fix-missing-long-long-math-
 prototypes-when-using-the.patch

 The problematic code only takes effect on Mac OS X versions earlier than
 10.7.

 The problematic patch is also in the clang-10 and clang-9.0 ports.

 Is this the fix?

 {{{#!diff
 --- math.h.orig 2024-01-23 09:20:27.000000000 -0600
 +++ math.h      2024-01-23 09:21:11.000000000 -0600
 @@ -313,7 +313,9 @@

  # if __APPLE_BAD_MATH_H
  /* These prototypes are incorrectly omitted from <math.h> on Snow Leopard
 despite being available */
 +#  ifdef __cplusplus
  extern "C" {
 +#  endif
      extern long long int llrintl(long double);
      extern long long int llrint(double);
      extern long long int llrintf(float);
 @@ -321,7 +323,9 @@
      extern long long int llroundl(long double);
      extern long long int llround(double);
      extern long long int llroundf(float);
 +#  ifdef __cplusplus
  }
 +#  endif
  # endif
  #endif // __APPLE__

 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/69159#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list