Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] [PATCH] Some changes for Win32 build on develop branch

You should include a commit message explaining what and why this
patch is needed just for _starters_

Cheers,
Karl P


Arun Cherian <archerian@xxxxxxxxx> wrote:
> ---
>  client/client_shared.c | 5 +++++
>  src/conf_includedir.c  | 6 ++++--
>  src/mosquitto.c        | 1 +
>  src/signals.c          | 3 ++-
>  4 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/client/client_shared.c b/client/client_shared.c
> index 4d1882c..b0a288e 100644
> --- a/client/client_shared.c
> +++ b/client/client_shared.c
> @@ -31,6 +31,11 @@ Contributors:
>  #include <mosquitto.h>
>  #include "client_shared.h"
> 
> +#if defined(WIN32) || defined(WIN64)
> +#define strcasecmp _stricmp
> +#define strncasecmp _strnicmp
> +#endif /* Def WIN32 or Def WIN64 */
> +
>  static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url);
>  static int client_config_line_proc(struct mosq_config *cfg, int
> pub_or_sub, int argc, char *argv[]);
> 
> diff --git a/src/conf_includedir.c b/src/conf_includedir.c
> index 73614f7..14177ef 100644
> --- a/src/conf_includedir.c
> +++ b/src/conf_includedir.c
> @@ -57,6 +57,8 @@ int config__get_dir_files(const char *include_dir, char
> ***files, int *file_coun
>   char **l_files = NULL;
>   int l_file_count = 0;
>   char **files_tmp;
> + int len;
> + int i;
> 
>   HANDLE fh;
>   char dirpath[MAX_PATH];
> @@ -79,7 +81,7 @@ int config__get_dir_files(const char *include_dir, char
> ***files, int *file_coun
>   mosquitto__free(l_files[i]);
>   }
>   mosquitto__free(l_files);
> - closedir(dh);
> + FindClose(fh);
>   return MOSQ_ERR_NOMEM;
>   }
>   l_files = files_tmp;
> @@ -90,7 +92,7 @@ int config__get_dir_files(const char *include_dir, char
> ***files, int *file_coun
>   mosquitto__free(l_files[i]);
>   }
>   mosquitto__free(l_files);
> - closedir(dh);
> + FindClose(fh);
>   return MOSQ_ERR_NOMEM;
>   }
>   snprintf(l_files[l_file_count-1], len, "%s/%s", include_dir,
> find_data.cFileName);
> diff --git a/src/mosquitto.c b/src/mosquitto.c
> index c160e75..ad86bb7 100644
> --- a/src/mosquitto.c
> +++ b/src/mosquitto.c
> @@ -343,6 +343,7 @@ int main(int argc, char *argv[])
>   signal(SIGPIPE, SIG_IGN);
>  #endif
>  #ifdef WIN32
> +    DWORD WINAPI SigThreadProc(void* data);
>   CreateThread(NULL, 0, SigThreadProc, NULL, 0, NULL);
>  #endif
> 
> diff --git a/src/signals.c b/src/signals.c
> index a4154c7..58da14b 100644
> --- a/src/signals.c
> +++ b/src/signals.c
> @@ -129,7 +129,8 @@ DWORD WINAPI SigThreadProc(void* data)
>   case WAIT_OBJECT_0 + 2:
>   handle_sigusr1(0);
>   continue;
> - break;
> + break;
> + }
>   }
>   CloseHandle(evt[0]);
>   CloseHandle(evt[1]);
> -- 
> 2.14.1.windows.1
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or
> unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/mosquitto-dev

Attachment: signature.html
Description: OpenPGP Digital Signature


Back to the top