#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only

# Check if the first parameter appears in the rest. Succeeds if found.
# This helper is useful if a particular option was passed to this script.
# Typically used like this:
#   arg_contain <word-you-are-searching-for> "$@"
arg_contain ()
{
	search="$1"
	shift

	while [ $# -gt 0 ]
	do
		if [ "$search" = "$1" ]; then
			return 0
		fi
		shift
	done

	return 1
}

if arg_contain --version "$@"; then
   echo "bindgen 0.71.1"
   exit 0
fi

# FIXME: assuming the pragma-messages for clang version check
echo "clang diag: xxx:0:0: warning: clang version 21.1.8  [-W#pragma-messages]" >&2
echo "/* automatically generated by rust-bindgen 0.71.1 */"
echo
echo
exit 0
