[MacPorts] #61868: libusb @1.0.24: cannot parse USB.h with mainline gcc versions due to variant pragma handling not accepted by gcc

MacPorts noreply at macports.org
Mon Oct 25 20:48:28 UTC 2021


#61868: libusb @1.0.24: cannot parse USB.h with mainline gcc versions due to
variant pragma handling not accepted by gcc
-----------------------------------+-----------------------
  Reporter:  dgonyier              |      Owner:  michaelld
      Type:  defect                |     Status:  reopened
  Priority:  Normal                |  Milestone:
 Component:  ports                 |    Version:  2.6.4
Resolution:                        |   Keywords:
      Port:  libusb, libusb-devel  |
-----------------------------------+-----------------------

Comment (by evanmiller):

 @michaelld I think that will work. As mentioned there may be other headers
 with this same issue (esp. in old SDKs) but we can whack the moles as they
 rear up their heads.

 So I'm thinking something like

 {{{
 #if (gcc version match)
 #pragma options align=power
 #pragma options align=power
 #pragma options align=power
 #pragma options align=power
 #pragma options align=power
 #endif

 #include_next <IOKit/usb/USB.h>
 }}}

 And then ports can do

 {{{
 # USB.h GCC fix
 legacysupport.newest_darwin_requires_legacy 18
 }}}

 To be even more careful, we could adjust the number of {{{align=power}}}
 instances to exactly match the number of {{{align=reset}}}s based on the
 SDK version. However, I can't think of any harm in having too many, so
 that additional logic seems unnecessary. The most resets that I counted in
 the USB.h of any SDK version was five.

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


More information about the macports-tickets mailing list