...

Source file src/cmd/cgo/internal/testgodefs/testdata/anonunion.go

Documentation: cmd/cgo/internal/testgodefs/testdata

     1  // Copyright 2014 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build ignore
     6  
     7  package main
     8  
     9  // This file tests that when cgo -godefs sees a struct with a field
    10  // that is an anonymous union, the first field in the union is
    11  // promoted to become a field of the struct.  See issue 6677 for
    12  // background.
    13  
    14  /*
    15  typedef struct {
    16  	union {
    17  		long l;
    18  		int c;
    19  	};
    20  } t;
    21  */
    22  import "C"
    23  
    24  // Input for cgo -godefs.
    25  
    26  type T C.t
    27  

View as plain text