• Hiroshi Ioka's avatar
    cmd/cgo: support niladic function-like macros · 03876af9
    Hiroshi Ioka authored
    Currently, cgo supports only macros which can be reduced to constants
    or variables. The CL addresses remaining parts, macros which can be
    represented as niladic functions.
    
    The basic idea is simple:
      1. make a thin wrapper function per macros.
      2. replace macro expansions with function calls.
    
    Fixes #10715
    Fixes #18720
    
    Change-Id: I150b4fb48e9dc4cc34466ef6417c04ac93d4bc1a
    Reviewed-on: https://go-review.googlesource.com/43970
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    03876af9
run.go 4.59 KB