mirror of
https://github.com/lovell/sharp.git
synced 2025-07-10 11:00:14 +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;
|
argv[2] = info;
|
||||||
} else {
|
} else {
|
||||||
// Add file size to info
|
// Add file size to info
|
||||||
struct stat st;
|
GStatBuf st;
|
||||||
g_stat(baton->output.c_str(), &st);
|
g_stat(baton->output.c_str(), &st);
|
||||||
info->Set(NanNew<String>("size"), NanNew<Uint32>(static_cast<uint32_t>(st.st_size)));
|
info->Set(NanNew<String>("size"), NanNew<Uint32>(static_cast<uint32_t>(st.st_size)));
|
||||||
argv[1] = info;
|
argv[1] = info;
|
||||||
|
@ -76,7 +76,7 @@ NAN_METHOD(counters) {
|
|||||||
NAN_METHOD(libvipsVersion) {
|
NAN_METHOD(libvipsVersion) {
|
||||||
NanScope();
|
NanScope();
|
||||||
char version[9];
|
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));
|
NanReturnValue(NanNew<String>(version));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user