Module: wine
Branch: master
Commit: 032e8d9c362b881a4213c819d1cc6262f2df4b35
URL: https://gitlab.winehq.org/wine/wine/-/commit/032e8d9c362b881a4213c819d1cc62…
Author: Hans Leidekker <hans(a)codeweavers.com>
Date: Tue Feb 7 21:40:23 2023 +0100
configure: Check for pcap_init() instead of pcap_create().
pcap_init() will be required by later patches and it was introduced after pcap_create().
---
configure | 22 +++++++++++-----------
configure.ac | 4 ++--
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/configure b/configure
index f07125ef8f6..aae3f417b67 100755
--- a/configure
+++ b/configure
@@ -15708,9 +15708,9 @@ fi
if test "$ac_cv_header_pcap_pcap_h" = "yes"
then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap_create in -lpcap" >&5
-printf %s "checking for pcap_create in -lpcap... " >&6; }
-if test ${ac_cv_lib_pcap_pcap_create+y}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap_init in -lpcap" >&5
+printf %s "checking for pcap_init in -lpcap... " >&6; }
+if test ${ac_cv_lib_pcap_pcap_init+y}
then :
printf %s "(cached) " >&6
else $as_nop
@@ -15722,35 +15722,35 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
-char pcap_create ();
+char pcap_init ();
int
main (void)
{
-return pcap_create ();
+return pcap_init ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
- ac_cv_lib_pcap_pcap_create=yes
+ ac_cv_lib_pcap_pcap_init=yes
else $as_nop
- ac_cv_lib_pcap_pcap_create=no
+ ac_cv_lib_pcap_pcap_init=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_pcap_create" >&5
-printf "%s\n" "$ac_cv_lib_pcap_pcap_create" >&6; }
-if test "x$ac_cv_lib_pcap_pcap_create" = xyes
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_pcap_init" >&5
+printf "%s\n" "$ac_cv_lib_pcap_pcap_init" >&6; }
+if test "x$ac_cv_lib_pcap_pcap_init" = xyes
then :
PCAP_LIBS="-lpcap"
fi
fi
-if test "x$ac_cv_lib_pcap_pcap_create" != xyes
+if test "x$ac_cv_lib_pcap_pcap_init" != xyes
then :
case "x$with_pcap" in
x) as_fn_append wine_notices "|pcap ${notice_platform}development files not found, wpcap won't be supported." ;;
diff --git a/configure.ac b/configure.ac
index 6410f8a0e42..3d996c34fae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1371,9 +1371,9 @@ WINE_NOTICE_WITH(opencl,[test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes],
dnl **** Check for libpcap ****
if test "$ac_cv_header_pcap_pcap_h" = "yes"
then
- AC_CHECK_LIB(pcap,pcap_create,[AC_SUBST(PCAP_LIBS,["-lpcap"])])
+ AC_CHECK_LIB(pcap,pcap_init,[AC_SUBST(PCAP_LIBS,["-lpcap"])])
fi
-WINE_NOTICE_WITH(pcap,[test "x$ac_cv_lib_pcap_pcap_create" != xyes],
+WINE_NOTICE_WITH(pcap,[test "x$ac_cv_lib_pcap_pcap_init" != xyes],
[pcap ${notice_platform}development files not found, wpcap won't be supported.],
[enable_wpcap])
Module: vkd3d
Branch: master
Commit: 38964214cd65cd429e7882b3f848e8f8966d56a9
URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/38964214cd65cd429e7882b3f848e…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Mon Sep 13 23:48:38 2021 -0500
vkd3d-shader/hlsl: Handle early return after a CF block only if there was actually a return somewhere in the CF block.
---
libs/vkd3d-shader/hlsl_codegen.c | 65 ++++++++++++++++++++++++----------------
1 file changed, 39 insertions(+), 26 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c
index 2e5feff1..80d52dfc 100644
--- a/libs/vkd3d-shader/hlsl_codegen.c
+++ b/libs/vkd3d-shader/hlsl_codegen.c
@@ -520,11 +520,12 @@ static void insert_early_return_break(struct hlsl_ctx *ctx,
}
/* Remove HLSL_IR_JUMP_RETURN calls by altering subsequent control flow. */
-static void lower_return(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *func,
+static bool lower_return(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *func,
struct hlsl_block *block, bool in_loop)
{
struct hlsl_ir_node *return_instr = NULL, *cf_instr = NULL;
struct hlsl_ir_node *instr, *next;
+ bool has_early_return = false;
/* SM1 has no function calls. SM4 does, but native d3dcompiler inlines
* everything anyway. We are safest following suit.
@@ -546,7 +547,7 @@ static void lower_return(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *fun
* return into a break, which offers the right semantics—except that it
* won't break out of nested loops.
*
- * - A CF block which might contain a return statement. After calling
+ * - A CF block which contains a return statement. After calling
* lower_return() on the CF block body, we stop, pull out everything after
* the CF instruction, shove it into an if block, and then lower that if
* block.
@@ -559,6 +560,9 @@ static void lower_return(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *fun
* already turned any returns into breaks. If the block we just processed
* was conditional, then "break" did our work for us. If it was a loop,
* we need to propagate that break to the outer loop.
+ *
+ * We return true if there was an early return anywhere in the block we just
+ * processed (including CF contained inside that block).
*/
LIST_FOR_EACH_ENTRY_SAFE(instr, next, &block->instrs, struct hlsl_ir_node, entry)
@@ -573,32 +577,38 @@ static void lower_return(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *fun
{
struct hlsl_ir_if *iff = hlsl_ir_if(instr);
- lower_return(ctx, func, &iff->then_instrs, in_loop);
- lower_return(ctx, func, &iff->else_instrs, in_loop);
+ has_early_return |= lower_return(ctx, func, &iff->then_instrs, in_loop);
+ has_early_return |= lower_return(ctx, func, &iff->else_instrs, in_loop);
- /* If we're in a loop, we don't need to do anything here. We
- * turned the return into a break, and that will already skip
- * anything that comes after this "if" block. */
- if (!in_loop)
+ if (has_early_return)
{
- cf_instr = instr;
- break;
+ /* If we're in a loop, we don't need to do anything here. We
+ * turned the return into a break, and that will already skip
+ * anything that comes after this "if" block. */
+ if (!in_loop)
+ {
+ cf_instr = instr;
+ break;
+ }
}
}
else if (instr->type == HLSL_IR_LOOP)
{
- lower_return(ctx, func, &hlsl_ir_loop(instr)->body, true);
+ has_early_return |= lower_return(ctx, func, &hlsl_ir_loop(instr)->body, true);
- if (in_loop)
- {
- /* "instr" is a nested loop. "return" breaks out of all
- * loops, so break out of this one too now. */
- insert_early_return_break(ctx, func, instr);
- }
- else
+ if (has_early_return)
{
- cf_instr = instr;
- break;
+ if (in_loop)
+ {
+ /* "instr" is a nested loop. "return" breaks out of all
+ * loops, so break out of this one too now. */
+ insert_early_return_break(ctx, func, instr);
+ }
+ else
+ {
+ cf_instr = instr;
+ break;
+ }
}
}
else if (instr->type == HLSL_IR_JUMP)
@@ -610,13 +620,14 @@ static void lower_return(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *fun
if (jump->type == HLSL_IR_JUMP_RETURN)
{
if (!(constant = hlsl_new_bool_constant(ctx, true, &jump->node.loc)))
- return;
+ return false;
list_add_before(&jump->node.entry, &constant->node.entry);
if (!(store = hlsl_new_simple_store(ctx, func->early_return_var, &constant->node)))
- return;
+ return false;
list_add_after(&constant->node.entry, &store->node.entry);
+ has_early_return = true;
if (in_loop)
{
jump->type = HLSL_IR_JUMP_BREAK;
@@ -658,24 +669,26 @@ static void lower_return(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *fun
assert(!in_loop);
if (tail == &cf_instr->entry)
- return;
+ return has_early_return;
if (!(load = hlsl_new_var_load(ctx, func->early_return_var, cf_instr->loc)))
- return;
+ return false;
list_add_tail(&block->instrs, &load->node.entry);
if (!(not = hlsl_new_unary_expr(ctx, HLSL_OP1_LOGIC_NOT, &load->node, cf_instr->loc)))
- return;
+ return false;
list_add_tail(&block->instrs, ¬->entry);
if (!(iff = hlsl_new_if(ctx, not, cf_instr->loc)))
- return;
+ return false;
list_add_tail(&block->instrs, &iff->node.entry);
list_move_slice_tail(&iff->then_instrs.instrs, list_next(&block->instrs, &cf_instr->entry), tail);
lower_return(ctx, func, &iff->then_instrs, in_loop);
}
+
+ return has_early_return;
}
/* Remove HLSL_IR_CALL instructions by inlining them. */