The workaround would now cause build failures in Appveyor as seem to
have pre-emptively applied it to their environments.
I'm not too happy about their handling of the issue. Seems fiddly.
Anyway this commit is now required to build on Appveyor.
We have now again two functions called h_platform_vasprintf and
h_platform_asprintf. On windows they are implemented in terms of vsnprint
and the like. On BSD/GNU libraries we use the supplied vasprintf and
asprintf.
We replace instances of void* w/ char* arithmetics.
This allows system_allocator.c to be compiled with MSVC.
Also we introduce a struct to represent the size_t header.
We substitute H_GCC_ATTRIBUTE to any occurence of __attribute__ and
disable its function with non gcc, non clang compilers.
We use a H_ macro so as to not pollute users' namespaces.
On windows build without c4201 so as to allow anonymous struct. This
shows hammer is not C99 compliant but rather C11.
In order to guarantee that Hammer can build on Windows, an appveyor.yml
and associated build scripts will build hammer and its examples. The idea
is that as soon as the appveyor.yml exists in the repository, pull
requests that would impede Windows portability would be immediately
detected.
The scripts expect CL.EXE to be in the path, and will produce their
results in build/
The highest level of warning is enabled on CL.EXE, minus warnings that
bring CL.EXE to a level that ressembles C99. The only notable warning
that was disabled is the one that tells you about implicit truncating
conversions.
Hammer's source code has quite a few implicit conversions say from a 64bit
unsigned integer to a integer of a lesser size (signed or otherwise)
The pretty printing format chosen is USER:<token name>
We use the registry function `h_get_token_type_name` which returns 0
when no name has been defined. This will print (null) as a token name.
Now we can do things like:
# copy-paste from output
ring.<t,L,tie,Cn,M,Ln,I,D,J,Rn,A,K,F,G> = QQ[]
ID = ring.ideal(L - (1*Cn*t),tie - (1*Ln*t),Cn - (1*I + 1*J),M - (1*t^2),Ln - (1*D + 1*L + 1*M),I - (1*Rn*t),D - (1*Rn*t),J - (1*Ln*t),Rn - (1*F + 1*G + 1*K),A - (1*tie),K - (1*t^2),F - (1*Ln*t),G - (1*Cn*t))
# we are interested in tie in terms of t; so we want to remove anything not these two:
ID.elimination_ideal([L,Cn,M,Ln,I,D,J,Rn,A,K,F,G])
# output from this SageMath command is
# Ideal (t^3 + 2*t^2*tie + t*tie - tie) of Multivariate Polynomial Ring in t, L, tie, Cn, M, Ln, I, D, J, Rn, A, K, F, G over Rational Field
# which we can solve for tie to get tie = t^3/(1-t-2*t^2) just as expected