Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix build with -ansi and without optimisation.
strdup(), strcasecmp(), vsyslog(), and other things need feature macros
defined. For some reason this only bites when optimisation is disabled.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Nov 3, 2011
1 parent edf1c87 commit a338b57
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cstp.c
Expand Up @@ -22,6 +22,8 @@
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#define _BSD_SOURCE
#include <netdb.h>
#include <unistd.h>
#include <fcntl.h>
Expand Down
3 changes: 2 additions & 1 deletion dtls.c
Expand Up @@ -22,6 +22,7 @@
* Boston, MA 02110-1301 USA
*/

#define _BSD_SOURCE
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -185,7 +186,7 @@ int connect_dtls_socket(struct openconnect_info *vpninfo)
vpninfo->dtls_attempt_period = 0;
return -EINVAL;
}
vpninfo->dtls_session->ssl_version = 0x0100; // DTLS1_BAD_VER
vpninfo->dtls_session->ssl_version = 0x0100; /* DTLS1_BAD_VER */
}

/* Do this every time; it may have changed due to a rekey */
Expand Down
5 changes: 5 additions & 0 deletions main.c
Expand Up @@ -23,6 +23,8 @@
* Boston, MA 02110-1301 USA
*/

#define _BSD_SOURCE
#define _POSIX_SOURCE
#include <stdio.h>
#ifdef ANDROID
#include <android/log.h>
Expand All @@ -33,6 +35,9 @@
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
Expand Down
1 change: 1 addition & 0 deletions mainloop.c
Expand Up @@ -22,6 +22,7 @@
* Boston, MA 02110-1301 USA
*/

#define _POSIX_SOURCE
#include <errno.h>
#include <poll.h>
#include <limits.h>
Expand Down
1 change: 1 addition & 0 deletions openconnect-internal.h
Expand Up @@ -40,6 +40,7 @@
#include LIBPROXY_HDR
#endif
#ifdef ENABLE_NLS
#include <locale.h>
#include <libintl.h>
#define _(s) dgettext("openconnect", s)
#else
Expand Down
2 changes: 2 additions & 0 deletions tun.c
Expand Up @@ -22,6 +22,8 @@
* Boston, MA 02110-1301 USA
*/

#define _BSD_SOURCE
#define _POSIX_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
Expand Down

0 comments on commit a338b57

Please sign in to comment.