mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-01 13:10:47 +00:00
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5243 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
e1e3336eaa
commit
08ca60d1bf
3 changed files with 9 additions and 2 deletions
|
@ -917,22 +917,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define FTE_ALIGN(a)
|
||||
#endif
|
||||
|
||||
//fte_inline must only be used in headers, and requires one and ONLY one fte_inlinebody elsewhere.
|
||||
//fte_inlinebody must be used on a prototype OUTSIDE of a header.
|
||||
//fte_inlinestatic must not be used inside any headers at all.
|
||||
#if __STDC_VERSION__ >= 199901L
|
||||
//C99 specifies that an inline function is used as a hint. there should be an actual body/copy somewhere (extern inline foo).
|
||||
#define fte_inline inline //must have non-line 'int foo();' somewhere
|
||||
#define fte_inlinebody extern inline
|
||||
#define fte_inlinestatic static inline
|
||||
#elif defined(_MSC_VER)
|
||||
//msvc will inline like C++. and that's fine.
|
||||
#define fte_inline __inline //c++ style
|
||||
#define fte_inlinebody
|
||||
#define fte_inlinestatic static __inline
|
||||
#elif (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
|
||||
//gcc will generally inline where it can - so long as its static. but that doesn't stop it warning
|
||||
#define fte_inline __attribute__((unused)) static
|
||||
#define fte_inlinebody static
|
||||
#define fte_inlinestatic static
|
||||
#else
|
||||
//make it static so we at least don't get errors (might still get warnings. see above)
|
||||
#define fte_inline static
|
||||
#define fte_inlinebody static
|
||||
#define fte_inlinestatic static
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -2195,7 +2195,7 @@ struct cmdargcompletion_ctx_s
|
|||
cmd_completion_t *res;
|
||||
const char *desc;
|
||||
};
|
||||
static fte_inline int Q_tolower(char c)
|
||||
fte_inlinestatic int Q_tolower(char c)
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
c -= ('a' - 'A');
|
||||
|
|
|
@ -480,7 +480,7 @@ char *Q_strlwr(char *s)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static char fte_inline Q_tolower(char c)
|
||||
fte_inlinestatic char Q_tolower(char c)
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
return c-'A'+'a';
|
||||
|
|
Loading…
Reference in a new issue