koolhazz / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

MinGW: function-macro name collision in src/base/atomicops-internals-*.h: MemoryBarrier #632

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. sh configure
2. make

What is the expected output? What do you see instead?
Expected to compile without problems.

Output:
In file included from ./src/base/atomicops.h:114:0,
                 from src/base/spinlock.h:43,
                 from src/common.cc:38:
./src/base/atomicops-internals-x86.h:143:27: error: expected unqualified-id 
before ')' token
 inline void MemoryBarrier() {
                           ^
src/common.cc:276:1: error: expected '}' at end of input
 }  // namespace tcmalloc
 ^
src/common.cc:276:1: error: expected '}' at end of input
make: *** [libtcmalloc_minimal_internal_la-common.lo] Error 1

What version of the product are you using? On what operating system?
Windows 7, MinGW g++ 4.8.1, gperftools 2.2.1

Please provide any additional information below.
In MinGW, the file include/winnt.h defines the macro MemoryBarrier, which 
collides with the function defined in src/base/atomicops-internals-*.h .

Original issue reported on code.google.com by amit.la...@mail.huji.ac.il on 2 Jul 2014 at 8:18

GoogleCodeExporter commented 9 years ago
I was unable to reproduce this. Just tried fresh mingw installation.

I will need specific instructions how to reproduce your environment. But it is 
likely that your version of mingw is too broken.

Original comment by alkondratenko on 29 Nov 2014 at 10:45

GoogleCodeExporter commented 9 years ago
Issue 653 has been merged into this issue.

Original comment by alkondratenko on 29 Nov 2014 at 10:48