[Bug bootstrap/39503] New: libgcc2.c doesn't compile anymore

2009-03-19 Thread forumer at smartmobili dot com
When trying to generate a cross-compiler targeting arm-wince-pe I have noticed
that libgcc2.c was not compiling anymore because of the following function :

int
mprotect (char *addr, int len, int prot)
{
  DWORD np, op;

  if (prot == 7)
np = 0x40;
  else if (prot == 5)
np = 0x20;
  else if (prot == 4)
np = 0x10;
  else if (prot == 3)
np = 0x04;
  else if (prot == 1)
np = 0x02;
  else if (prot == 0)
np = 0x01;

  if (VirtualProtect (addr, len, np, &op))
return 0;
  else
return -1;
}


The problem comes from the DWORD because compiler doesn't know its
definition.
Before is was defined as an int and everything was working fine.
By the way I think you should use a unsigned long instead of a int because
a DWORD is defined like this :

typedef unsigned long   DWORD;


-- 
   Summary: libgcc2.c doesn't compile anymore
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: critical
  Priority: P3
 Component: bootstrap
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: forumer at smartmobili dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39503



[Bug bootstrap/39503] libgcc2.c doesn't compile anymore

2009-03-19 Thread forumer at smartmobili dot com


--- Comment #1 from forumer at smartmobili dot com  2009-03-19 15:45 ---
Hum maybe there is a problem in my defines because libgcc2 is using some
windows functions and in particular mprotect so maybe I should try to find why
DWORD is not defined in my case.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39503



[Bug bootstrap/39503] [4.4 Regression] libgcc2.c doesn't compile anymore

2009-03-24 Thread forumer at smartmobili dot com


--- Comment #6 from forumer at smartmobili dot com  2009-03-24 13:51 ---
I think you can close it because I suppose the problem only happens with my
includes/toolchains.
I don't know why but normally DWORD definitions should be known since
VirtualProtect is.If you really wanted to make everyone happy, you could define
unsigned long instead of DWORD.


-- 

forumer at smartmobili dot com changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39503