Signed-off-by: Darryl L. Pierce dpierce@redhat.com --- src/host.cpp | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/host.cpp b/src/host.cpp index d6955a5..29dcc29 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -162,7 +162,6 @@ host_get_architecture()
if(architecture.empty()) { - #ifdef __linux__ struct utsname details;
@@ -170,8 +169,9 @@ host_get_architecture() { architecture = string(details.machine); } -#endif +#elif defined WIN32
+#endif }
return architecture; @@ -184,15 +184,18 @@ host_get_memory()
if(!memory) { - #ifdef __linux__ struct sysinfo sysinf; if(!sysinfo(&sysinf)) { memory = sysinf.totalram / 1024L; } -#endif +#elif defined WIN32 + MEMORYSTATUS status;
+ GlobalMemoryStatus(&status); + memory = status.dwTotalPhys / 1024L; +#endif }
return memory;
On Tue, Jul 27, 2010 at 2:03 PM, Darryl L. Pierce dpierce@redhat.com wrote:
Signed-off-by: Darryl L. Pierce dpierce@redhat.com
src/host.cpp | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/host.cpp b/src/host.cpp index d6955a5..29dcc29 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -162,7 +162,6 @@ host_get_architecture()
if(architecture.empty()) {
#ifdef __linux__ struct utsname details;
@@ -170,8 +169,9 @@ host_get_architecture() { architecture = string(details.machine); } -#endif +#elif defined WIN32
Should we fill in a default here? Perhaps:
architecture = string("win32");
Otherwise, ACK
+#endif }
return architecture; @@ -184,15 +184,18 @@ host_get_memory()
if(!memory) {
#ifdef __linux__ struct sysinfo sysinf; if(!sysinfo(&sysinf)) { memory = sysinf.totalram / 1024L; } -#endif +#elif defined WIN32
MEMORYSTATUS status;
GlobalMemoryStatus(&status);
memory = status.dwTotalPhys / 1024L;
+#endif }
return memory;
1.7.2
Matahari mailing list Matahari@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/matahari
On Fri, Jul 30, 2010 at 02:08:42PM +0200, Andrew Beekhof wrote:
On Tue, Jul 27, 2010 at 2:03 PM, Darryl L. Pierce dpierce@redhat.com wrote:
Signed-off-by: Darryl L. Pierce dpierce@redhat.com
src/host.cpp | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/host.cpp b/src/host.cpp index d6955a5..29dcc29 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -162,7 +162,6 @@ host_get_architecture()
if(architecture.empty()) {
#ifdef __linux__ struct utsname details;
@@ -170,8 +169,9 @@ host_get_architecture() { architecture = string(details.machine); } -#endif +#elif defined WIN32
Should we fill in a default here? Perhaps:
architecture = string("win32");
Otherwise, ACK
The API needs to be more specific; i.e., this could be a 64-bit Windows platform. But, yes, we can set the architecture for the time being to be WIN32 based on the compiler directive at that point. I'll add that and then push the patch.
matahari@lists.fedorahosted.org