From: Junio C Hamano <hidden> Date: 2016-06-15 22:44:42
Boyd Lynn Gerber [off-list ref] writes:
So the patch should be
...
Thanks.
I'll apply, but I'd reword the part on _XOPEN_SOURCE like this:
Looking at the the various platform headers, I see around line 450:
#if defined(_KERNEL) || !defined(_POSIX_SOURCE) \
&& !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
which hides u_short and other typedefs that other header files on these
platforms depend on. With _XOPEN_SOURCE defined, sources that include
system header files that depend on the typedefs such as u_short cannot be
compiled on these platforms.
Honestly, I'd have to say that such platform header files are buggy ;-)
If they want to use u_short and other custom types for their internal use,
that is understandable and perfectly fine, and if they want to hide these
names when _POSIX or _XOPEN is defined because you are not supposed to
contaminate the namespace, that is also sensible, but at the same time you
(not you, Boyd, but whoever developed the system header files) should have
taken an alternate measure (perhaps by using __u_short or something) not
to break the features they declare in the other header files of their own.
And not defining _XOPEN nor _POSIX would be a reasonable workaround to
the problem on such systems.
This patch adds support to compile and run git on 12 additional platforms.
The platforms are based on UNIX Systems Labs (USL)/Novell/SYS V code base.
The most common are Novell UnixWare 2.X.X, SCO UnixWare 7.X.X,
OpenServer 5.0.X, OpenServer 6.0.X, and SCO pre OSR 5 platforms.
This is from
The problem is that git source has blocked some typedefs
by excluding certain <sys/types.h> content.
Looking at the the various platform header, I see around line 450
&& !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
which hides u_short and other typedefs that other header files on these
platforms dependon. With _XOPEN_SOURCE defined, sources that include
system header files that depend on the typedefs such as u_short cannot
be compiled on these platforms.
They all lead back to about line 66 in git-compat-util.h
I had to make the following changes
ned(_M_UNIX)
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 fo
r S_ISLNK() */
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
#endif
The _XOPEN_SOURCE hides many typedefs.
__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived
compiler and/or some SysV based OS's.
__M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases
of the SCO OS's. It is used just like Apple and BSD, both of these
shouldn't have _XOPEN_SOURCE defined.
This is with suggestions and modifications from
Daniel Barkalow [off-list ref]
Junio C Hamano [off-list ref]
Thomas Harning [off-list ref]
Jeremy Maitin-Shepard [off-list ref]
Signed-off-by: Boyd Lynn Gerber <redacted>
--
Boyd Gerber [off-list ref]
ZENEZ 1042 East Fort Union #135, Midvale Utah 84047
---
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
---
git-compat-util.h
__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived
compiler and/or some SysV based OS's.
__M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases
of the SCO OS's. It is used just like Apple and BSD, both of these
shouldn't have _XOPEN_SOURCE defined.
Dynamically sized arrays are gcc and C99 construct. Using them hurts
portability to older compilers, although using them is nice in this case
it is not desirable. This patch removes the only use of the construct
in stop_progress_msg(); the function is about writing out a single line
of a message, and the existing callers of this function feed messages
of only bounded size anyway, so use of dynamic array is simply overkill.
This is with suggestions from
Daniel Barkalow [off-list ref]
Junio C Hamano [off-list ref]
Thomas Harning [off-list ref]
Jeremy Maitin-Shepard [off-list ref]
Signed-off-by: Boyd Lynn Gerber <redacted>
--
Boyd Gerber [off-list ref]
ZENEZ 1042 East Fort Union #135, Midvale Utah 84047
---
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
---
progress.c
Changes for older OS's that do not support the current methods for
allocation of memory.
Honestly, I'd have to say that such platform header files are buggy ;-)
I agree, but getting various things changed is near impossible.
Especially since they are either in a retired or unmaintained state.
Although a few are still release updated products, they refuse to change
them citeing backword compatibility.
If they want to use u_short and other custom types for their internal use,
that is understandable and perfectly fine, and if they want to hide these
names when _POSIX or _XOPEN is defined because you are not supposed to
contaminate the namespace, that is also sensible, but at the same time you
(not you, Boyd, but whoever developed the system header files) should have
taken an alternate measure (perhaps by using __u_short or something) not
to break the features they declare in the other header files of their own.
I agree +1
And not defining _XOPEN nor _POSIX would be a reasonable workaround to
the problem on such systems.
Agreed.
Thanks,
--
Boyd Gerber [off-list ref]
ZENEZ 1042 East Fort Union #135, Midvale Utah 84047