Skip to content

Commit

Permalink
configure: guard config.h with #ifdef CONFIG_H
Browse files Browse the repository at this point in the history
Rename CONFIG_H guard in defs.h to DEFS_H
This avoids a redeclaration issue on DragonFly.
  • Loading branch information
rsmarples committed Nov 8, 2023
1 parent 2d07224 commit 2913df5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ echo "Configuring dhcpcd for ... $OS"
rm -f $CONFIG_H $CONFIG_MK
echo "# $OS" >$CONFIG_MK
echo "/* $OS */" >$CONFIG_H
echo >>$CONFIG_H
echo "#ifndef CONFIG_H">>$CONFIG_H
echo "#define CONFIG_H">>$CONFIG_H
echo >>$CONFIG_H

: ${SYSCONFDIR:=$PREFIX/etc}
: ${SBINDIR:=$PREFIX/sbin}
Expand Down Expand Up @@ -1918,6 +1922,9 @@ if ! $HOOKSET; then
fi
fi

echo >>$CONFIG_H
echo "#endif /*CONFIG_H*/">>$CONFIG_H

find_hook()
{
for h in [0-9][0-9]"-$x" [0-9][0-9]"-$x.in" \
Expand Down
4 changes: 2 additions & 2 deletions src/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* SUCH DAMAGE.
*/

#ifndef CONFIG_H
#define CONFIG_H
#ifndef DEFS_H
#define DEFS_H

#define PACKAGE "dhcpcd"
#define VERSION "10.0.4"
Expand Down

0 comments on commit 2913df5

Please sign in to comment.