From: Keith M. <no...@so...> - 2017-11-28 16:50:58
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Repository: mingw-org-wsl". The branch, 5.0-active has been updated via d4d38f3736b22bb3b91b9f9010093a877a0dd0bd (commit) from 4aa4a7a511f0fb7bf267088539aed97af93e4b71 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sf.net/p/mingw/mingw-org-wsl/ci/d4d38f3736b22bb3b91b9f9010093a877a0dd0bd/ commit d4d38f3736b22bb3b91b9f9010093a877a0dd0bd Author: Keith Marshall <ke...@us...> Date: Tue Nov 28 16:48:29 2017 +0000 Make <wsnetbs.h> header effectively self-contained. diff --git a/w32api/ChangeLog b/w32api/ChangeLog index e1919ca..c806b90 100644 --- a/w32api/ChangeLog +++ b/w32api/ChangeLog @@ -1,5 +1,14 @@ 2017-11-28 Keith Marshall <ke...@us...> + Make <wsnetbs.h> header effectively self-contained. + + * include/wsnetbs.h: Assert copyright; tidy layout; include + "_winsock.h", so making this header effectively self-contained, and + thus relieving the user of a responsibility for ensuring that some + other appropriate WinSock header has been included first. + +2017-11-28 Keith Marshall <ke...@us...> + Factor <winsock.h> duplicate content out of <winsock2.h> * include/winsock2.h: Remove all declarations and definitions which diff --git a/w32api/include/wsnetbs.h b/w32api/include/wsnetbs.h index e435b5d..9914efc 100644 --- a/w32api/include/wsnetbs.h +++ b/w32api/include/wsnetbs.h @@ -1,35 +1,66 @@ +/* + * wsnetbs.h + * + * NetBIOS extensions to the standard WinSock API. + * + * $Id$ + * + * Written by Kai Henningsen <kai...@us...> + * Copyright (C) 2002, 2017, MinGW.org Project + * + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ #ifndef _WSNETBS_H -#define _WSNETBS_H -#if __GNUC__ >=3 #pragma GCC system_header -#endif +#define _WSNETBS_H -#define NETBIOS_NAME_LENGTH 16 -#define NETBIOS_UNIQUE_NAME 0 -#define NETBIOS_GROUP_NAME 1 -#define NETBIOS_TYPE_QUICK_UNIQUE 2 -#define NETBIOS_TYPE_QUICK_GROUP 3 +#define NETBIOS_NAME_LENGTH 16 +#define NETBIOS_UNIQUE_NAME 0 +#define NETBIOS_GROUP_NAME 1 +#define NETBIOS_TYPE_QUICK_UNIQUE 2 +#define NETBIOS_TYPE_QUICK_GROUP 3 #ifndef RC_INVOKED -typedef struct sockaddr_nb { - short snb_family; - u_short snb_type; - char snb_name[NETBIOS_NAME_LENGTH]; + +#include "_winsock.h" + +typedef struct sockaddr_nb +{ short snb_family; + u_short snb_type; + char snb_name[NETBIOS_NAME_LENGTH]; } SOCKADDR_NB, *PSOCKADDR_NB, *LPSOCKADDR_NB; -#define SET_NETBIOS_SOCKADDR(_snb,_type,_name,_port) \ -{ \ - register int _i; \ - register char *_n = (_name); \ - register PSOCKADDR_NB _s = (_snb); \ - _s->snb_family = AF_NETBIOS; \ - _s->snb_type = (_type); \ - for (_i=0; _n[_i] != '\0' && _i<NETBIOS_NAME_LENGTH-1; _i++) { \ - _s->snb_name[_i] = _n[_i]; \ - } \ - for (; _i<NETBIOS_NAME_LENGTH-1; _i++) { \ - _s->snb_name[_i] = ' '; \ - } \ - _s->snb_name[NETBIOS_NAME_LENGTH-1] = (_port); \ -} -#endif /* RC_INVOKED */ -#endif + +#define SET_NETBIOS_SOCKADDR(_snb,_type,_name,_port) \ + { register int _i; \ + register char *_n = (_name); \ + register PSOCKADDR_NB _s = (_snb); \ + _s->snb_family = AF_NETBIOS; \ + _s->snb_type = (_type); \ + for (_i = 0; _n[_i] != '\0' && _i < NETBIOS_NAME_LENGTH - 1; _i++) \ + { _s->snb_name[_i] = _n[_i]; } \ + while (_i < NETBIOS_NAME_LENGTH - 1) \ + { _s->snb_name[_i++] = ' '; } \ + _s->snb_name[NETBIOS_NAME_LENGTH - 1] = (_port); \ + } + +#endif /* RC_INVOKED */ +#endif /* !_WSNETBS_H: $RCSfile$: end of file */ ----------------------------------------------------------------------- Summary of changes: w32api/ChangeLog | 9 +++++ w32api/include/wsnetbs.h | 89 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 69 insertions(+), 29 deletions(-) hooks/post-receive -- Repository: mingw-org-wsl |