mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 12:36:09 -07:00
Various C99 compatibility fixes
strrchr is declared in <strings.h>, not <string.h>. _GNU_SOURCE needs to be defined before any glibc headers are included, otherwise it is not effective. Also patch some old autoconf-internal issues in the hydra-gtk configure script.
This commit is contained in:
parent
c6a3f77476
commit
a41d10dc8c
3 changed files with 7 additions and 6 deletions
2
configure
vendored
2
configure
vendored
|
@ -1356,7 +1356,7 @@ echo "Checking for Android specialities ..."
|
||||||
TMPC=comptest$$
|
TMPC=comptest$$
|
||||||
STRRCHR=" not"
|
STRRCHR=" not"
|
||||||
echo '#include <stdio.h>' > $TMPC.c
|
echo '#include <stdio.h>' > $TMPC.c
|
||||||
echo '#include <strings.h>' >> $TMPC.c
|
echo '#include <string.h>' >> $TMPC.c
|
||||||
echo "int main() { char *x = strrchr(\"test\", 'e'); if (x == NULL) return 0; else return 1; }" >> $TMPC.c
|
echo "int main() { char *x = strrchr(\"test\", 'e'); if (x == NULL) return 0; else return 1; }" >> $TMPC.c
|
||||||
$CC -o $TMPC $TMPC.c > /dev/null 2>&1
|
$CC -o $TMPC $TMPC.c > /dev/null 2>&1
|
||||||
test -x $TMPC && STRRCHR=""
|
test -x $TMPC && STRRCHR=""
|
||||||
|
|
8
hydra-gtk/configure
vendored
8
hydra-gtk/configure
vendored
|
@ -2391,7 +2391,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
(exit $ac_status); }; }; then
|
(exit $ac_status); }; }; then
|
||||||
for ac_declaration in \
|
for ac_declaration in \
|
||||||
'' \
|
'#include <stdlib.h>' \
|
||||||
'extern "C" void std::exit (int) throw (); using std::exit;' \
|
'extern "C" void std::exit (int) throw (); using std::exit;' \
|
||||||
'extern "C" void std::exit (int); using std::exit;' \
|
'extern "C" void std::exit (int); using std::exit;' \
|
||||||
'extern "C" void exit (int) throw ();' \
|
'extern "C" void exit (int) throw ();' \
|
||||||
|
@ -3192,7 +3192,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
(exit $ac_status); }; }; then
|
(exit $ac_status); }; }; then
|
||||||
for ac_declaration in \
|
for ac_declaration in \
|
||||||
'' \
|
'#include <stdlib.h>' \
|
||||||
'extern "C" void std::exit (int) throw (); using std::exit;' \
|
'extern "C" void std::exit (int) throw (); using std::exit;' \
|
||||||
'extern "C" void std::exit (int); using std::exit;' \
|
'extern "C" void std::exit (int); using std::exit;' \
|
||||||
'extern "C" void exit (int) throw ();' \
|
'extern "C" void exit (int) throw ();' \
|
||||||
|
@ -3797,8 +3797,8 @@ main ()
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
if (XOR (islower (i), ISLOWER (i))
|
if (XOR (islower (i), ISLOWER (i))
|
||||||
|| toupper (i) != TOUPPER (i))
|
|| toupper (i) != TOUPPER (i))
|
||||||
exit(2);
|
return 2;
|
||||||
exit (0);
|
return 0;
|
||||||
}
|
}
|
||||||
_ACEOF
|
_ACEOF
|
||||||
rm -f conftest$ac_exeext
|
rm -f conftest$ac_exeext
|
||||||
|
|
|
@ -6,10 +6,11 @@
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include "hydra-mod.h"
|
#include "hydra-mod.h"
|
||||||
#include "sasl.h"
|
#include "sasl.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define _GNU_SOURCE
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue