Archive for November, 2007

C/C++ Compiler Macros

Tuesday, November 27th, 2007

cityscape_night.pngEvery once in awhile, I need a macro to work around a difference in a C compiler.

For example, not every compiler for the Win32 platform has implemented C99 integer and boolean types, so I have stdint.h and stdbool.h files. Fortunately, The Open Group maintains an online definition for stdint.h and stdbool.h so I don’t have to guess about what is supposed to go in there. C99 also defines some new keywords: restrict, inline, _Complex, _Imaginary, _Bool. Since _Bool is used by stdbool.h, it may or may not have been defined by the compiler. What I needed was a macro defined by the compiler that tells me which compiler it is so I can avoid compiler warnings.

Digging up the compiler macros on the internet can be challenging. However, there is a nice project at SourceForge to track Pre-defined C/C++ Compiler Macros.

That makes things a whole lot easier!

Character problems after WordPress upgrade on Bluehost

Saturday, November 17th, 2007

seal_on_rockI recently upgraded the WordPress install on BlueHost at Kargs.net. The install and upgrade were done using the Fanstastico user interface. After the install, I found that some of the characters in the older postings (mostly the quote character) were shown as unusual characters. After a number of searches, I found the solution.

1. Modify the wp-config.php by commenting out

//define('DB_CHARSET', 'utf8');
//define('DB_COLLATE', '');

2. Modify the wp-config-sample.php by commenting out

//define('DB_CHARSET', 'utf8');
//define('DB_COLLATE', '');

The second file, wp-config-sample.php, is used to prevent breakage in future upgrades.