mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
patched for CYGWIN
This commit is contained in:
@@ -65,13 +65,13 @@ static size_t get_sysmem(struct sys_memory *memall);
|
|||||||
|
|
||||||
/* Print to stream the given memory size in a human friendly format */
|
/* Print to stream the given memory size in a human friendly format */
|
||||||
static void
|
static void
|
||||||
fprintmem(FILE* stream, long long memory) {
|
fprintmem(FILE* stream, unsigned long long memory) {
|
||||||
if (memory > 1048576)
|
if (memory > 1048576)
|
||||||
fprintf(stream, "%8.6f MB", memory/1048576.);
|
fprintf(stream, "%8.6f MB", memory/1048576.);
|
||||||
else if (memory > 1024)
|
else if (memory > 1024)
|
||||||
fprintf(stream, "%5.3f kB", memory/1024.);
|
fprintf(stream, "%5.3f kB", memory/1024.);
|
||||||
else
|
else
|
||||||
fprintf(stream, "%lu bytes", memory);
|
fprintf(stream, "%lu bytes", (unsigned long)memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ static size_t get_sysmem(struct sys_memory *memall) {
|
|||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
size_t bytes_read;
|
size_t bytes_read;
|
||||||
char *match;
|
char *match;
|
||||||
long long mem_got;
|
int64 mem_got;
|
||||||
|
|
||||||
if((fp = fopen("/proc/meminfo", "r")) == NULL) {
|
if((fp = fopen("/proc/meminfo", "r")) == NULL) {
|
||||||
perror("fopen(\"/proc/meminfo\")");
|
perror("fopen(\"/proc/meminfo\")");
|
||||||
|
|||||||
Reference in New Issue
Block a user