Skip to content

Commit bb0394e

Browse files
committed
Fixed the _write bug with proper codegen modification
1 parent e7140a8 commit bb0394e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

build/f_gnutls_build.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ BLD_CONFIG_BUILD_ADDL_CFLAGS=( "-I../gl/" )
1111
BLD_CONFIG_BUILD_ADDL_CFLAGS_STATIC=("-DASN1_STATIC")
1212
BLD_CONFIG_OUR_LIB_DEPS=("libtasn1" "p11-kit" "zlib")
1313
BLD_CONFIG_OUR_LIB_BINS_PATH=("libtasn1")
14-
BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" )
14+
BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" "4996" )
1515

1616
# BLD_CONFIG_BUILD_FOLDER_NAME="myapp2"; #if you want it compiling in a diff folder
1717
# BLD_CONFIG_BUILD_DEBUG=1
@@ -29,6 +29,13 @@ fi
2929

3030
if [[ -z $SKIP_STEP || $SKIP_STEP == "our_patch" ]]; then
3131
apply_our_repo_patch; # Applies from patches folder repo_BUILD_NAME.patch to the sources
32+
P11_FILE="cligen/cligen/code.py"
33+
if [[ -e "${P11_FILE}" ]]; then
34+
if grep -q "^struct {struct_name} {global_name};" "${P11_FILE}"; then
35+
ex sed -i -E 's/^struct \{struct_name\} \{global_name\};/struct {struct_name} {global_name} ;\n#undef write/' "${P11_FILE}" # fix issue where write is refined to _write but then .write on a struct has problems
36+
echo "Fixed ${P11_FILE} for _write bug"
37+
fi
38+
fi
3239
fi
3340

3441
if [[ $BLD_CONFIG_GNU_LIBS_USED -eq "1" ]]; then
@@ -72,13 +79,7 @@ fi
7279
else
7380
setup_build_env;
7481
fi
75-
P11_FILE="src/p11tool-options.c"
76-
if [[ -e "${P11_FILE}" ]]; then
77-
if grep -Fq " p11tool_options;" "${P11_FILE}"; then
78-
sed -i -E 's/ p11tool_options;/ p11tool_options ;\n#undef write/' "${P11_FILE}" # fix issue where write is refined to _write but then .write on a struct has problems
79-
echo "Fixed ${P11_FILE} for _write bug"
80-
fi
81-
fi
82+
8283

8384
run_make
8485
make_install

0 commit comments

Comments
 (0)