diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-04 23:46:40 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-04 23:46:40 +0000 |
commit | 66be059151e9c96380e9e1555d287260f6bc8763 (patch) | |
tree | e265894330462bf486748fc4147de24c1f37d4b8 /include | |
parent | f86cc8722b75f85a66c6427b02390a58454fbb44 (diff) |
Modify file.h to maintain API compatibility with earlier versions. If a recent
compiler is being used, then a warning will show up for any modules still using
the old name "private" instead of "_private".
(patch suggested by paravoid)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91032 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/autoconfig.h.in | 3 | ||||
-rw-r--r-- | include/asterisk/compiler.h | 6 | ||||
-rw-r--r-- | include/asterisk/file.h | 8 |
3 files changed, 16 insertions, 1 deletions
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in index 92ac3f7ce..d5a6faa1b 100644 --- a/include/asterisk/autoconfig.h.in +++ b/include/asterisk/autoconfig.h.in @@ -47,6 +47,9 @@ /* Define to 1 if your GCC C compiler supports the 'const' attribute. */ #undef HAVE_ATTRIBUTE_const +/* Define to 1 if your GCC C compiler supports the 'deprecated' attribute. */ +#undef HAVE_ATTRIBUTE_deprecated + /* Define to 1 if your GCC C compiler supports the 'malloc' attribute. */ #undef HAVE_ATTRIBUTE_malloc diff --git a/include/asterisk/compiler.h b/include/asterisk/compiler.h index 8ac441463..0955b8c8f 100644 --- a/include/asterisk/compiler.h +++ b/include/asterisk/compiler.h @@ -53,4 +53,10 @@ #define attribute_malloc #endif +#if HAVE_ATTRIBUTE_deprecated +#define attribute_deprecated __attribute__((deprecated)) +#else +#define attribute_deprecated +#endif + #endif /* _ASTERISK_COMPILER_H */ diff --git a/include/asterisk/file.h b/include/asterisk/file.h index fc1aa2157..636309bc4 100644 --- a/include/asterisk/file.h +++ b/include/asterisk/file.h @@ -132,7 +132,13 @@ struct ast_filestream { FILE *f; struct ast_frame fr; /* frame produced by read, typically */ char *buf; /* buffer pointed to by ast_frame; */ - void *_private; /* pointer to private buffer */ + /* pointer to private buffer */ + union { + void *_private; +#if !defined(__cplusplus) && !defined(c_plusplus) + void *private attribute_deprecated; +#endif + }; const char *orig_chan_name; }; |