`
byebyegov5qq
  • 浏览: 1219581 次
文章分类
社区版块
存档分类
最新评论

libpam:shadow.h:error: expected declaration specifiers before '__THROW'

 
阅读更多

When I'm makeing libpam, it claims that there's no shadow.h. Then I found a shadow.h.

But another issue shows up: error: expected declaration specifiers before '__THROW'.

This is because Android gcc is using cdefs.h of the following version:

/*$NetBSD: cdefs.h,v 1.58 2004/12/11 05:59:00 christos Exp $*/

And there's no '__THROW' definition in it.

So I copy '__THROW' definition from the GNU gcc cdefs.h .

Here's the definition :

#ifdef __GNUC__

/* GCC can always grok prototypes. For C++ programs we add throw()
to help it optimize the function calls. But this works only with
gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
as non-throwing using a function attribute since programs can use
the -fexceptions options for C code as well. */
# if !defined __cplusplus && __GNUC_PREREQ__ (3, 3)
# define __THROW__attribute__ ((__nothrow__))
# define __NTH(fct)__attribute__ ((__nothrow__)) fct
# else
# if defined __cplusplus && __GNUC_PREREQ__ (2,8)
# define __THROWthrow ()
# define __NTH(fct)fct throw ()
# else
# define __THROW
# define __NTH(fct)fct
# endif
# endif

#else/* Not GCC. */

# define __inline/* No inline functions. */

# define __THROW
# define __NTH(fct)fct

# define __constconst
# define __signedsigned
# define __volatilevolatile

#endif/* GCC. */

it seems to be fine now.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics