Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

16, 32 bit machine etc.

Name: Anonymous 2006-01-21 5:24

Anyone know how to check if a machine is 16 bit, 32 bit etc?
I need to make my C++ program portable,
but I'm not sure what macro can I use to accomplish this

Name: Anonymous 2006-01-21 7:15

Check to see if the "long long" type is supported.

Name: Anonymous 2006-01-21 10:05

umm...I'm trying to do something like
#ifdef machine_is_32_bit
#else
#endif

any idea?

Name: Anonymous 2006-01-21 10:16

First tell me why you think you need to know if the machine is 16 bit or 32 bit, and then I'll tell you what you really want to do.

Name: Anonymous 2006-01-21 13:52

there are many reasons. such as adding DS_LOCALEDIT flag, selecting the best type for a template (i.e. 32 bit int for 32 bit machine) etc.

Name: Anonymous 2006-01-21 13:53

there are many reasons. such as adding DS_LOCALEDIT flag, selecting the best type for a template (i.e. 32 bit int for 32 bit machine) etc.

Name: Anonymous 2006-01-21 14:58

>> such as adding DS_LOCALEDIT flag
You're compiling for Windows? Then search the documentation Microsoft so kindly make available to you.

>> selecting the best type for a template (i.e. 32 bit int for 32 bit machine)
And are you aware of what the definition of int is?

Name: Anonymous 2006-01-21 15:19

How do I optimized prematurely.

Name: Anonymous 2006-01-21 17:59

isn't it something like: 8 * sizeof (int), or something? I could be wrong because I never rely on such values but...

Name: Anonymous 2006-01-24 4:30 (sage)

>>9
any up to date compiler would do something like that. you would probably see that kind of thing in bits of legacy code.

Name: Anonymous 2006-01-30 21:54

>>8
HEAR HEAR

Who compiles code for 16-bit x86 these days anyhow, outside the embedded world? And in the embedded devices biz you rarely recycle code, let alone write in C++. (Can't predict what the compiler produces being the reason.)

Name: Anonymous 2006-01-31 6:12

>>1
Create common.h, with:

#define MY_PLATFORM
//Change to YOUR_PLATFORM

#ifdef MY_PLATFORM
typedef int32 long
typedef Uint32 unsigned long
typedef int64 long long
...etc...
#endif

#ifdef YOUR_PLATFORM
...
#endif

#ifdef ANOTHER_PLATFORM
...

Name: Anonymous 2006-01-31 10:09

>>11
ZSNES. That's all I can think of, though.

Name: Anonymous 2006-02-02 17:41

>>13
But... wasn't everything even remotely interesting for DOS (i.e. like after 1993 or so) done in a 32-bit mode driver? DOS4GW comes to mind, though that was a bit later. I doubt that the ZSNES guys would go out of their way to support 16-bit DOS (i.e. 286-class things) given that it's a multiplatform project...

Name: Anonymous 2009-09-17 15:56

Lain.

Name: Anonymous 2009-09-17 15:57

Lain.

Name: Anonymous 2009-09-17 15:57

Lain.

Name: Anonymous 2009-09-17 15:58

Lain.

Name: Anonymous 2009-09-17 15:58

Lain.

Name: Anonymous 2009-09-17 15:59

Lain.

Name: Anonymous 2009-09-17 15:59

Lain.

Name: Anonymous 2009-09-17 16:00

Lain.

Name: Anonymous 2009-09-17 16:01

Lain.

Name: Anonymous 2009-09-17 16:01

Lain.

Name: Anonymous 2009-09-17 16:02

Lain.

Name: Anonymous 2009-09-17 16:02

Lain.

Name: !!bs+RJAOyXTwZJRG 2010-01-02 16:57

Don't mind me

Name: Anonymous 2011-02-04 15:03

Name: Anonymous 2011-11-22 3:07

‮?‭I‮o‭t‮d‭'‮ ‭s‮e‭ ‮w‭a‮ ‭l‮o‭l‮d‭ ‮ ‭f‮t‭u‮a‭c‮h‭k‮W‭e‮ ‭d‮.‭ ‮w‭n‮oy‬o‬ ‬u‬e‬ ‬v‬d‬a‬o‬h‬n‬ ‬e‬t‬ ‬a‬t‬h‬o‬w‬ ‬ ‬/‬d‬p‬o‬r‬g‬o‬ ‬g‬h‬/‬O‬?

test

Name: Anonymous 2012-01-12 11:20

[b][i][u]Hax my anus /prog/[/b][/i][/u]

Name: Anonymous 2012-01-12 11:21

[b][i][u][o]Hax my anus /pro[sup][b][i]Hax my anus /prog/[/b][/i][/u]
g[/sup]/[/b][/i]
[/o]

Name: Anonymous 2012-01-12 11:21

Hax my anus /prog/

Name: Anonymous 2012-01-12 11:22

[b][i][u][o][sup]Hax[sub] [sub]my [sup]a[sup]nus[sub] [sub]/pr[sup]o[sup]g/[/o][/u][/i][/b]

Name: Anonymous 2012-01-12 11:25

Hax my anus /prog/

[b][i][u][o]Hax[sub] my [sup]anus[sub] /pr[sup]og/[/o][/u][/i][/b]

Name: Anonymous 2012-01-12 11:26

H[/sup]ax[/sub] m[/sup]y [/sub]an[/sup]us[/sub] /[/sup]pr[/sub]og[/sup]/


Ha[/sup]x my anus /prog/

Name: Anonymous 2012-01-12 11:28

[b][i][u][o]Ha[sub]x[sub] my[sup] [sup]anu[sub]s[sub] /p[sup]r[sup]og/[/o][/u][/i][/b]

[b][i][u][o]Hax[sub] [sub]m[sub]y an[sup]u[sup]s[sup] /pr[sub]o[sub]g[sub]/[/o][/u][/i][/b]

Name: Anonymous 2012-01-12 11:29

[b][i][u][o]Ha[sub]x m[sup]y a[sub]nus[sup] /p[sub]rog[sup]/[/o][/u][/i][/b]


[b][i][u][o]Hax[sub] [sub]my a[sup]n[sup]us /[sub]p[sub]rog/[/o][/u][/i][/b]

Name: Anonymous 2012-01-12 11:32

[b][i][u][o]Ha[sub]x [sup]my[sub] a[sup]nu[sub]s [sup]/p[sub]ro[sup]g/[/o][/u][/i][/b]

[b][i][u][o]Hax[sub] my [sup]anus[sub] /pr[sup]og/[/o][/u][/i][/b]

Name: Anonymous 2012-01-12 11:35

Hax my anus /prog/

Name: Anonymous 2012-01-12 11:35

[b][i][u][o]Hax[sub] my [sup]anus[sub] /pr[sup]og/[/o][/u][/i][/b]

Name: Anonymous 2012-01-12 11:42

fuc[sub]kkkkk

Name: Anonymous 2012-01-12 11:44

[sup]fuc[sub]k[sub]k[/sup][/sup]kkk

Name: Anonymous 2012-01-12 12:03



testing

Name: Anonymous 2012-01-12 12:04

testingtestin[sup]g

testingtestin[sub]g

Name: Anonymous 2012-01-12 12:06

testingtestin[sup]g[/sub][/sub]

testingtestin[sub]g[/sup][/sup]

testingtesting[/sup]

Name: Anonymous 2012-01-12 12:08


testingtesting

testingtesting

testingtestin[sup]g[/sub]

Name: Anonymous 2012-02-15 16:06

Name: Anonymous 2012-02-15 16:15

>>1

That's simply not possible standard-wise: it actually does not make any sense whatsoever.

In practice, however, sizeof(void*) can be used as a hint to detect whether you're compiling in a 32-bit or 64-bit environment, though it is useless as a preprocessor token.

Name: Anonymous 2012-02-15 20:01

CHAR_BIT and sizeof(void *) are the closest things C has to a concept of "bit width." All standard integer types must be supported on all C implementations and it's possible for a machine with e.g. 64-bit data registers to use a 16-bit int or for a machine to have 128-bit pointers and a 16-bit size_t.

Don't change these.
Name: Email:
Entire Thread Thread List