new type 'l_noret' for function that do not return

This commit is contained in:
Roberto Ierusalimschy
2011-10-07 17:45:19 -03:00
parent 9bbfe9f3fd
commit 217e67cb22
6 changed files with 42 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: llimits.h,v 1.91 2011/09/13 17:39:23 roberto Exp roberto $
** $Id: llimits.h,v 1.92 2011/09/30 12:46:06 roberto Exp roberto $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ -96,6 +96,19 @@ typedef LUAI_UACNUMBER l_uacNumber;
#define cast_uchar(i) cast(unsigned char, (i))
/*
** non-return type
*/
#if defined(__GNUC__)
#define l_noret void __attribute__((noreturn))
#elif defined(_MSC_VER)
#define l_noret void __declspec(noreturn)
#else
#define l_noret void
#endif
/*
** maximum depth for nested C calls and syntactical nested non-terminals
** in a program. (Value must fit in an unsigned short int.)