-
macros and size of
sizes.h:7:11: error: missing binary operator before token "("
the error above always occurs in this code and I don't know whats wrong..
Code:
#ifndef SIZES_H_
#define SIZES_H_
#include <stdlib.h>
/* Figure out how big your integers need to be */
#if(sizeof(long int) == 4)
typedef unsigned long int int_u8;
typedef unsigned int int_u4;
typedef unsigned short int int_u2;
typedef unsigned char int_u1;
typedef long int int_8;
typedef int int_4;
typedef short int int_2;
typedef char int_1;
#else
typedef unsigned long long int int_u8;
typedef unsigned long int int_u4;
typedef unsigned short int int_u2;
typedef unsigned char int_u1;
typedef long long int int_8;
typedef long int int_4;
typedef short int int_2;
typedef char int_1;
#endif
#endif /* SIZES_H_ */
-
#if is evalueted by preprocessor
sizeof - by compiler... so you are trying to set a cart before the horse
-
hmm..so how can I do this?? I am trying to see if my machine is a 32 bit or not and assign the correct typedef ...
-
you should look for your project settings - for example my Win32 project settings include WIN32 define i can use in this #ifdef construct
I suppose the win64 configuration will include WIN64 define...
-
-
Quote:
Originally Posted by
-EquinoX-
how do I check that?
In VS - go to Project/Properties/C++/Preprocessor/Preprocessor Definitions
In other IDEs It should be something similar
-