RLH
RLH

Reputation: 15698

What is the OSX, C equivalent for uint32 and uint64?

I imagine this is a question that has been asked a thousand times but I can't find a straight answer.

I'm trying to port a very short, C function (initially written for Windows) to OSX, using XCode.

I've created an XCode, Terminal application project and I've copied and pasted the code into the project. XCode is giving me a bunch of errors telling me that the type uint32 and uint64 are unknown types.

What are the equivalent value types in OSX?

Upvotes: 8

Views: 8327

Answers (4)

pkluz
pkluz

Reputation: 4881

Try these ;-) UInt32 lala; UInt64 lolo;

Misread the question. If you create a terminal only project you won't be linking Cocoa/Foundation and Carbon. Within the latter UInt16/32/64 are typedef'ed.

Upvotes: 0

Linuxios
Linuxios

Reputation: 35788

What you want are the POSIX and C standard integer types. These are what are used on Mac OSX, Linux, Solaris, etc. They are uint8_t all the way through uint64_t. There are also int8_t through uint8_t.

Upvotes: 3

Tommy
Tommy

Reputation: 100632

uint32_t and uint64_t — both defined in stdint.h as per the C99 definition.

The others are Microsoft's proprietary solution.

Upvotes: 2

Jon Shier
Jon Shier

Reputation: 12780

You can use uint32_t and uint64_t by importing stdint.h.

Upvotes: 18

Related Questions