Allow building with MSVC and Strawberry perl
authorAndrew Dunstan <[email protected]>
Fri, 25 Nov 2022 20:28:38 +0000 (15:28 -0500)
committerAndrew Dunstan <[email protected]>
Fri, 25 Nov 2022 20:37:33 +0000 (15:37 -0500)
Strawberry uses __builtin_expect which Visual C doesn't have. For this
case define it as a noop. Solution taken from vim sources.

Backpatch to all live branches

src/pl/plperl/plperl.h

index fbaf98fa825cb951dcf900aae99aafcbfae60c4b..88fb03718d84294258773df18fb6f555e57cad8f 100644 (file)
@@ -54,6 +54,8 @@
 #ifdef isnan
 #undef isnan
 #endif
+/* Work around for using MSVC and Strawberry Perl >= 5.30. */
+#define __builtin_expect(expr, val) (expr)
 #endif
 
 /*