[Libwebsockets] [libwebsockets] reserved identifier violation (#21)

"Andy Green (林安廸)" andy at warmcat.com
Sat Oct 26 14:26:16 CEST 2013


On 26/10/13 00:55, the mail apparently from Markus Elfring included:
> Would you like to improve include guards?

Thanks, it is cleaner.

http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=7521233176ff0524fce648c8382c2cdf46a9a796

-Andy

> |diff --git a/lib/getifaddrs.h b/lib/getifaddrs.h
> index 7871932..da69b50 100644
> --- a/lib/getifaddrs.h
> +++ b/lib/getifaddrs.h
> @@ -40,8 +40,8 @@ extern "C" {
>
>   /* $KTH: ifaddrs.hin,v 1.3 2000/12/11 00:01:13 assar Exp $ */
>
> -#ifndef __ifaddrs_h__
> -#define __ifaddrs_h__
> +#ifndef ifaddrs_h_7467027A95AD4B5C8DDD40FE7D973791
> +#define ifaddrs_h_7467027A95AD4B5C8DDD40FE7D973791
>
>   /*
>    * the interface is defined in terms of the fields below, and this is
> diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h
> index 72a3769..d5fdaeb 100644
> --- a/lib/libwebsockets.h
> +++ b/lib/libwebsockets.h
> @@ -19,8 +19,8 @@
>    *  MA  02110-1301  USA
>    */
>
> -#ifndef __LIBWEBSOCKET_H__
> -#define __LIBWEBSOCKET_H__
> +#ifndef LIBWEBSOCKET_H_3060898B846849FF9F88F5DB59B5950C
> +#define LIBWEBSOCKET_H_3060898B846849FF9F88F5DB59B5950C
>
>   #ifdef __cplusplus
>   extern "C" {
> |
>
> Is the renaming of a function also feasible?
>
> |diff --git a/lib/client-handshake.c b/lib/client-handshake.c
> index 83d8f21..41a9fa8 100644
> --- a/lib/client-handshake.c
> +++ b/lib/client-handshake.c
> @@ -1,6 +1,6 @@
>   #include "private-libwebsockets.h"
>
> -struct libwebsocket *__libwebsocket_client_connect_2(
> +struct libwebsocket *libwebsocket_client_connect_2(
>          struct libwebsocket_context *context,
>          struct libwebsocket *wsi
>   ) {
> @@ -11,7 +11,7 @@ struct libwebsocket *__libwebsocket_client_connect_2(
>          int plen = 0;
>          const char *ads;
>
> -       lwsl_client("__libwebsocket_client_connect_2\n");
> +       lwsl_client("libwebsocket_client_connect_2\n");
>
>          /*
>           * proxy?
> @@ -35,7 +35,7 @@ struct libwebsocket *__libwebsocket_client_connect_2(
>          /*
>           * prepare the actual connection (to the proxy, if any)
>           */
> -       lwsl_client("__libwebsocket_client_connect_2: address %s\n", ads);
> +       lwsl_client("libwebsocket_client_connect_2: address %s\n", ads);
>
>          server_hostent = gethostbyname(ads);
>          if (server_hostent == NULL) {
> @@ -309,7 +309,7 @@ libwebsocket_client_connect(struct libwebsocket_context *context,
>   #endif
>          lwsl_client("libwebsocket_client_connect: direct conn\n");
>
> -       return __libwebsocket_client_connect_2(context, wsi);
> +       return libwebsocket_client_connect_2(context, wsi);
>
>   bail1:
>          free(wsi->u.hdr.ah);
> diff --git a/lib/client.c b/lib/client.c
> index 7e81df5..a1eef71 100644
> --- a/lib/client.c
> +++ b/lib/client.c
> @@ -52,7 +52,7 @@ int lws_client_socket_service(struct libwebsocket_context *context,
>                   * timeout protection set in client-handshake.c
>                   */
>
> -               if (__libwebsocket_client_connect_2(context, wsi) == NULL) {
> +               if (libwebsocket_client_connect_2(context, wsi) == NULL) {
>                          /* closed */
>                          lwsl_client("closed\n");
>                          return -1;
> diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h
> index b68b9f5..24ee858 100644
> --- a/lib/private-libwebsockets.h
> +++ b/lib/private-libwebsockets.h
> @@ -447,7 +447,7 @@ libwebsocket_service_timeout_check(struct libwebsocket_context *context,
>                                      struct libwebsocket *wsi, unsigned int sec);
>
>   LWS_EXTERN struct libwebsocket *
> -__libwebsocket_client_connect_2(struct libwebsocket_context *context,
> +libwebsocket_client_connect_2(struct libwebsocket_context *context,
>          struct libwebsocket *wsi);
>
>   LWS_EXTERN struct libwebsocket *
> |
>
>> Reply to this email directly or view it on GitHub
> <https://github.com/warmcat/libwebsockets/issues/21#issuecomment-27108309>.
>




More information about the Libwebsockets mailing list