• Elias Naur's avatar
    runtime/cgo: make sure nil is undefined before defining it · 7a2a96d6
    Elias Naur authored
    While working on standalone builds of gomobile bindings, I ran into
    errors on the form:
    
    gcc_darwin_arm.c:30:31: error: ambiguous expansion of macro 'nil' [-Werror,-Wambiguous-macro]
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/MacTypes.h:94:15: note: expanding this definition of 'nil'
    
    Fix it by undefining nil before defining it in libcgo.h.
    
    Change-Id: I8e9660a68c6c351e592684d03d529f0d182c0493
    Reviewed-on: https://go-review.googlesource.com/99215
    Run-TryBot: Elias Naur <elias.naur@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    7a2a96d6
gcc_darwin_arm.c 4.35 KB