Advertisement
bazz

var8x Mac OSX Additional Support patch

Sep 4th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.67 KB | None | 0 0
  1. --- var8x.c.orig    2015-09-04 23:45:27.000000000 -0400
  2. +++ var8x.c 2015-09-04 23:44:36.000000000 -0400
  3. @@ -1,6 +1,16 @@
  4.  #include <stdio.h>
  5.  #include <stdlib.h>
  6.  
  7. +#ifdef __APPLE__
  8. +#define STRNICMP2(x,y) strncasecmp(x,y,strlen(x))
  9. +#define STRNICMP3(x,y,z) strncasecmp(x,y,z)
  10. +// replace strnicmp invocations with strncasecmp
  11. +// the magic below let's us have a multiple argument macro overloader
  12. +// we need this since the code below calls strnicmp() with 2 and 3 args.
  13. +#define GET_MACRO(_1,_2,_3,NAME,...) NAME
  14. +#define strnicmp(...) GET_MACRO(__VA_ARGS__, STRNICMP3, STRNICMP2)(__VA_ARGS__)
  15. +#endif
  16. +
  17.  enum header_type {
  18.      header_raw,
  19.      header_zshell4,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement