[ 
https://issues.apache.org/jira/browse/PROTON-629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15147716#comment-15147716
 ] 

ASF subversion and git services commented on PROTON-629:
--------------------------------------------------------

Commit 13150e4935d0de0bf390db4474b22c20e72a54e7 in qpid-proton's branch 
refs/heads/master from [~astitcher]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=13150e4 ]

PROTON-629: Allow proton/delivery.h to be compiled as C89


> Can't include proton-c header files in c-only applications in visual studio
> ---------------------------------------------------------------------------
>
>                 Key: PROTON-629
>                 URL: https://issues.apache.org/jira/browse/PROTON-629
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: 0.7
>         Environment: Windows
>            Reporter: Sahir Hoda
>            Assignee: Andrew Stitcher
>              Labels: build, easyfix, patch
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The public API for the proton-c library includes the function in delivery.h:
> 61:static inline pn_delivery_tag_t pn_dtag(const char *bytes, size_t size)
> The 'inline' keyword is problematic for applications building with Visual 
> Studio in a non-C++ mode. Per the msdn doc 
> [http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx]:
> "The inline keyword is available only in C++. The __inline and __forceinline 
> keywords are available in both C and C++. For compatibility with previous 
> versions, _inline is a synonym for __inline."
> So 'inline' is only available for C++ applications, however C applications 
> must use the '__inline' keyword instead.
> To resolve this issue, I would suggest the following patch:
> diff --git a/proton-c/include/proton/type_compat.h 
> b/proton-c/include/proton/type_compat.h
> index 9501d9a..9423cf1 100644
> --- a/proton-c/include/proton/type_compat.h
> +++ b/proton-c/include/proton/type_compat.h
> @@ -130,4 +130,9 @@ typedef unsigned __int64 uint64_t;
>  # endif
>  #endif // PNI_DEFINE_SSIZE_T
>  
> +#if !defined(__cplusplus) && defined(_MSC_VER)
> +// visual studio and not using c++
> +  #define inline __inline
> +#endif
> +
>  #endif /* type_compat.h */



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to