Skip to content

Commit

Permalink
Fix build on non-linux systems. The HOST_NAME_MAX is not portable,
Browse files Browse the repository at this point in the history
POSIX way to find it out is to use sysconf(_SC_HOST_NAME_MAX),
but for now just fix it with ifndef.
  • Loading branch information
sobomax committed Jun 30, 2023
1 parent b555f31 commit cab9277
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* \brief OpenSIPS Debug console print functions
*/


#include "dprint.h"
#include "log_interface.h"
#include "globals.h"
Expand All @@ -35,6 +34,10 @@
#include <stdio.h>
#include <strings.h>

#if !defined(HOST_NAME_MAX)
#define HOST_NAME_MAX 255
#endif

/* used internally by the log interface */
typedef void (*log_print_pre_fmt_f)(log_print_f gen_print_func, int log_level,
int facility, char *module, const char *func,
Expand Down

0 comments on commit cab9277

Please sign in to comment.