Skip to content

Commit

Permalink
Add _GNU_SOURCE explicitly on Cygwin; probably fixes missing strcasestr
Browse files Browse the repository at this point in the history
Closes #400

Reported by @Vasya-M
  • Loading branch information
wdoekes committed May 27, 2019
1 parent 2b310ab commit c98d546
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 0 additions & 2 deletions include/strings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#ifndef __SIPP_STRINGS_H__
#define __SIPP_STRINGS_H__

#include <cstddef>

int get_decimal_from_hex(char hex);
void get_host_and_port(const char *addr, char *host, int *port);
void trim(char *s);
Expand Down
7 changes: 5 additions & 2 deletions src/sip_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@
* Walter Doekes
*/

#include <string.h>
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* needed for strcasestr on cygwin */
#endif

#include <stdlib.h>
#include <string.h>

#include "screen.hpp"
#include "strings.hpp"
#include "sip_parser.hpp"

/*************************** Mini SIP parser (internals) ***************/
Expand Down
6 changes: 6 additions & 0 deletions src/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@
* Michael Hirschbichler
*/

#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* needed for strcasestr on cygwin */
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include "sipp.hpp"
#include "socket.hpp"
#include "logger.hpp"
Expand Down

0 comments on commit c98d546

Please sign in to comment.