Skip to content

Commit

Permalink
non FreeBSD compat for printflike and friends
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmacy committed May 1, 2019
1 parent f5a3bdf commit 620e33c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions include/sys/cdefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef _ZOL_SYS_CDEFS_H_
#define _ZOL_SYS_CDEFS_H_

#if !defined(__FreeBSD__)
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
#define __printflike(fmtarg, firstvararg)
#define __scanflike(fmtarg, firstvararg)
#define __format_arg(fmtarg)
#define __strfmonlike(fmtarg, firstvararg)
#define __strftimelike(fmtarg, firstvararg)
#else
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#define __scanflike(fmtarg, firstvararg) \
__attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg)))
#define __strfmonlike(fmtarg, firstvararg) \
__attribute__((__format__ (__strfmon__, fmtarg, firstvararg)))
#define __strftimelike(fmtarg, firstvararg) \
__attribute__((__format__ (__strftime__, fmtarg, firstvararg)))
#endif
#endif
#include_next<sys/cdefs.h>

#endif

0 comments on commit 620e33c

Please sign in to comment.