64-bit enum type ?

Tech-Archive recommends: Speed Up your PC by fixing your registry




porting 32 to 64....


enum x {
port_a=34 ,
b=45 ,
c=78
}

if we use
WRITE_PORT_ULONG ( (PULONG)port_a, 1234 ) ;

compiler error
: error C4312: 'type cast' : conversion from 'int' to 'PULONG' of
greater size

Is there any enum64 kind of new data types for 64-bit driver porting ?

There are MANY occurances like this in a 32-bit driver code to be
ported to 64-bit.

A simple
enum_64_R_32 x { // will resolve to 32 or 64 based on build
port_a=34 ,
b=45 ,
c=78
}

could solve the problem, but there seems to be no such easy way out.

Any suggestions for quick porting ?

thx
ugk
.



Relevant Pages

  • Re: 64-bit enum type ?
    ... enum x { ... Is there any enum64 kind of new data types for 64-bit driver porting? ...
    (microsoft.public.development.device.drivers)
  • 64 bit data types
    ... From what I read the 64bit version of the .net 2.0 framework retains the size of the data types. ... I've been porting an app to run on a AMD x64 box and have been having a lot of trouble byte arrays. ...
    (microsoft.public.dotnet.languages.csharp)