On Tue, Jun 15, 2010 at 09:49:41AM +0200, Andrew Beekhof wrote:
I'm surprised to still see this sort of thing:
-string +const char* host_get_architecture() {
- return Platform::instance()->getArchitecture();
- return Platform::instance()->getArchitecture().c_str();
}
I don't think you want to be returning a const char *, thats going to be problematic for any property that might change.
I'll clean that up and resend the patch.
But mainly I would have expected something closer to:
char* host_get_architecture() { #ifdef LINUX /* Do something with /proc/cpuinfo */ #else /* windows stuff */ #endif }
And:
LinuxPlatform::getArchitecture() { return host_get_architecture(); }
Is that coming in a subsequent patch?
Yep. I'm replacing all of the C++ code, and today I plan on removing the Platform C++ type with code like you specified above.