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

Andrew Stitcher commented on PROTON-587:
----------------------------------------

#include <stddef.h>

seems to be the correct way to get the definition. This change looks fine.

> Proton 0.7 fails to compile with Visual Studio 2008
> ---------------------------------------------------
>
>                 Key: PROTON-587
>                 URL: https://issues.apache.org/jira/browse/PROTON-587
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: 0.7
>         Environment: Visual Studio 2008 x86 (32-bit) debug or relwithdebinfo.
> Note: VS2008 x64 (64-bit) works fine; VS2010 x86,x64 work fine.
>            Reporter: Chuck Rolke
>            Assignee: Andrew Stitcher
>
> Project recv.c fails to compile with size_t undefined.
> {noformat}
> 6>------ Build started: Project: recv, Configuration: Debug Win32 ------
> 6>Compiling...
> 6>recv.c
> 6>P:\qpid-proton-0.7\proton-c\include\proton/types.h(60) : error C2016: C 
> requires that a struct or union has at least one member
> 6>P:\qpid-proton-0.7\proton-c\include\proton/types.h(60) : error C2061: 
> syntax error : identifier 'size_t'
> 6>P:\qpid-proton-0.7\proton-c\include\proton/types.h(62) : error C2059: 
> syntax error : '}'
> ...
> {noformat}
> The issue if fixed easy enough with the inclusion of stddef.h or stdlib.h in 
> types.h
> {noformat}
> diff --git a/proton-c/include/proton/types.h b/proton-c/include/proton/types.h
> index 4182f25..d26d6a2 100644
> --- a/proton-c/include/proton/types.h
> +++ b/proton-c/include/proton/types.h
> @@ -23,6 +23,7 @@
>   */
>  #include <proton/import_export.h>
> +#include <stddef.h>
>  #include <sys/types.h>
>  #include <proton/type_compat.h>
> {noformat}
> Apologies for not catching this sooner but I've been using VS2010 almost 
> exclusively of late. The fix looks harmless enough but I'm wondering if 
> anyone has an reason to select stddef over stdlib or if there's a better 
> place to have the #include.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to