]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: support niladic function-like macros
authorHiroshi Ioka <hirochachacha@gmail.com>
Tue, 23 May 2017 14:01:08 +0000 (23:01 +0900)
committerIan Lance Taylor <iant@golang.org>
Wed, 30 Aug 2017 18:28:58 +0000 (18:28 +0000)
commit03876af91c50c6e0227218a856f037dd20a45729
tree5a9a5ca70dd66c93b64f66452ae5b4df95e0f691
parentc1679286c3911befd94f1ddb4b29fbdd12301da9
cmd/cgo: support niladic function-like macros

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: Ian Lance Taylor <iant@golang.org>
doc/progs/run.go
misc/cgo/test/issue18720.go
src/cmd/cgo/gcc.go
src/cmd/cgo/main.go
src/cmd/cgo/out.go