Skip to content

Commit

Permalink
Only define illumos-compat functions on non-illumos platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason King authored and arekinath committed May 8, 2019
1 parent 619c926 commit 94d4571
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

#include "libssh/ssherr.h"

#if !defined(__sun)
static void
ultos(uint64_t n, int base, char *s)
{
Expand Down Expand Up @@ -105,6 +106,7 @@ assfail3(const char *assertion, uintmax_t lv, const char *op, uintmax_t rv,
(void) strcat(buf, ")");
assfail(buf, filename, line_num);
}
#endif

const char *
ssh_err(int n)
Expand Down
12 changes: 7 additions & 5 deletions debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ extern "C" {

#include <stdint.h>

#if defined(__sun)
#include <sys/debug.h>
#else

#if !defined(__APPLE__)
typedef uint64_t uintmax_t;
#endif

#if !defined(__sun) && !defined(USING_SPL)
#if !defined(USING_SPL)
typedef /*@concrete@*/ enum { B_FALSE = 0, B_TRUE = 1 } boolean_t;
typedef /*@concrete@*/ unsigned int uint;
#endif

#if defined(__sun)
#include <sys/types.h>
#endif

#undef VERIFY
#undef ASSERT

Expand Down Expand Up @@ -150,6 +150,8 @@ extern void debug_enter(char *);
#define STATIC static
#endif

#endif /* defined(__sun) */

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 94d4571

Please sign in to comment.