zkjun / npapi-sdk

Automatically exported from code.google.com/p/npapi-sdk
0 stars 0 forks source link

Under MinGW bool and uintptr_t are unknown type names #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Download latest revision(r21) of npapi-sdk headers

2. Create, in the same folder as the headers, a file a.c:
#include "npfunctions.h"
#include <stdio.h>
int main(int argc, char *argv[])
{
  return 0;
}

3. With the MinGW Shell go to said folder and run:
gcc a.c

What is the expected output? What do you see instead?

The expected output is an executable: a.exe

Instead, I see a lot of errors related to 'uintptr_t' and 'bool' being unknown 
type names.

What operating system are you compiling on?

Windows XP, MinGW GCC 4.7.2

Please provide any additional information below.

I believe the reason for this issue is nptypes.h assuming that WIN32 has no 
knowledge of C99. It may be true for MSVC, but isn't true for MinGW( and 
probably not true for Cygwin, and maybe others, too).

In nptypes.h, if I replace, in line 47:
#if defined(WIN32) || defined(OS2)
with:
#if (defined(WIN32) && !defined(__GNUC__)) || defined(OS2)
the issue is resolved, for me.

Original issue reported on code.google.com by TamirE...@gmail.com on 3 Dec 2012 at 6:18

GoogleCodeExporter commented 9 years ago
I'm fine with the proposed change. Are you, Stuart? If so I'll commit it.

Original comment by josh....@gmail.com on 7 Dec 2012 at 11:46

GoogleCodeExporter commented 9 years ago
LGTM

Original comment by stuart.morgan on 9 Dec 2012 at 2:33

GoogleCodeExporter commented 9 years ago
Fixed

Original comment by josh....@gmail.com on 10 Dec 2012 at 10:28