mirror of
https://github.com/lovell/sharp.git
synced 2025-07-10 02:50:15 +02:00
Improve code portability ahead of Windows support
This commit is contained in:
parent
7ad7193b1e
commit
ce6813329b
@ -856,7 +856,7 @@ class ResizeWorker : public NanAsyncWorker {
|
||||
argv[2] = info;
|
||||
} else {
|
||||
// Add file size to info
|
||||
struct stat st;
|
||||
GStatBuf st;
|
||||
g_stat(baton->output.c_str(), &st);
|
||||
info->Set(NanNew<String>("size"), NanNew<Uint32>(static_cast<uint32_t>(st.st_size)));
|
||||
argv[1] = info;
|
||||
|
@ -76,7 +76,7 @@ NAN_METHOD(counters) {
|
||||
NAN_METHOD(libvipsVersion) {
|
||||
NanScope();
|
||||
char version[9];
|
||||
snprintf(version, sizeof(version), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2));
|
||||
g_snprintf(version, sizeof(version), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2));
|
||||
NanReturnValue(NanNew<String>(version));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user