Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.programming Subject: Re: 64 bit check? Date: Wed, 03 Apr 2013 10:09:24 +1300 Lines: 10 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 5FK3KpBPYkLtkxvKcqu1bA2P3zDhhNOdlLnu9v45DdlIn0Xc5c Cancel-Lock: sha1:PWHNeak2nwoVSQppI+IKqhVGIBo= User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Xref: csiph.com comp.programming:3218 bob wrote: > Is this a foolproof way to check if your code is running in 64 bit mode? > > int pointer_size = sizeof(int*); > boolean sixty_four_bit = (pointer_size==8) ? true : false; Define a constant at compile time based on the compiler's built in flags. -- Ian Collins