Skip to content

Commit c2ecde6

Browse files
authored
Windows: ensure C++ runtime is linked statically (#3110)
And remove the empty invalid parameter handler, which should be present in the C layer instead. This partially reverts commit 659cdab, the added test case in that commit is still preserved.
1 parent 55efe56 commit c2ecde6

2 files changed

Lines changed: 0 additions & 18 deletions

File tree

binding.gyp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
'VCCLCompilerTool': {
4040
'ExceptionHandling': 1,
4141
'Optimization': 1,
42-
'RuntimeLibrary': '2', # /MD
4342
'WholeProgramOptimization': 'true'
4443
},
4544
'VCLibrarianTool': {
@@ -206,7 +205,6 @@
206205
'VCCLCompilerTool': {
207206
'ExceptionHandling': 1,
208207
'Optimization': 1,
209-
'RuntimeLibrary': '2', # /MD
210208
'WholeProgramOptimization': 'true'
211209
},
212210
'VCLibrarianTool': {

src/sharp.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
#include <napi.h>
16-
#include <cstdlib>
1716
#include <vips/vips8>
1817

1918
#include "common.h"
@@ -22,14 +21,6 @@
2221
#include "utilities.h"
2322
#include "stats.h"
2423

25-
#if defined(_MSC_VER) && _MSC_VER >= 1400 // MSVC 2005/8
26-
static void empty_invalid_parameter_handler(const wchar_t* expression,
27-
const wchar_t* function, const wchar_t* file, unsigned int line,
28-
uintptr_t reserved) {
29-
// No-op.
30-
}
31-
#endif
32-
3324
static void* sharp_vips_init(void*) {
3425
g_setenv("VIPS_MIN_STACK_SIZE", "2m", FALSE);
3526
vips_init("sharp");
@@ -43,13 +34,6 @@ Napi::Object init(Napi::Env env, Napi::Object exports) {
4334
g_log_set_handler("VIPS", static_cast<GLogLevelFlags>(G_LOG_LEVEL_WARNING),
4435
static_cast<GLogFunc>(sharp::VipsWarningCallback), nullptr);
4536

46-
// Tell the CRT to not exit the application when an invalid parameter is
47-
// passed. The main issue is that invalid FDs will trigger this behaviour.
48-
// See: https://github.com/libvips/libvips/pull/2571.
49-
#if defined(_MSC_VER) && _MSC_VER >= 1400 // MSVC 2005/8
50-
_set_invalid_parameter_handler(empty_invalid_parameter_handler);
51-
#endif
52-
5337
// Methods available to JavaScript
5438
exports.Set("metadata", Napi::Function::New(env, metadata));
5539
exports.Set("pipeline", Napi::Function::New(env, pipeline));

0 commit comments

Comments
 (0)