Commit graph

21 commits

Author SHA1 Message Date
Alex Willmer
287f71d561 Fix uses of retired builtins and builtin methods
In Python 3.x

- int and long types are unified. The unified type is called int.
- the text string type (unicode) is renamed to str.
- the byte string type (str) is renamed to bytes.
- chr returns a text string (i.e. str)
- xrange is renamed to range.
- dict.has_key() is removed
-
2019-05-10 21:59:03 +01:00
Alex Willmer
0f3cadcc3e Enable absolute imports, true division, & print()
These have no effect in Python 3.x, they are the default. Enabling them
in Python 2.x, enabling them in Python 2.x allows single source
compatiblity.
2019-05-10 21:13:32 +01:00
nicolas
69d3e70211 Port scons build files for Windows users
We disable:
- the tests (which require glib) although they can be
  reactivated with the `--tests` command line flag
- shared library (lack of export symbol declarations
  means that although it can be built, no symbol is
  exported and therefore it can't be used)

The `install` target installs the library and headers
under the `build` folder, because it's a traditional practice
to move libraries to a central location on Windows, unless
you are using cygwin. In which case pass `prefix` to the
command line.

We adapt tools\windows\build_examples.bat to take the library
that is built using scons or using tools\windows\build.bat
2016-05-22 13:29:12 +02:00
Nicolas Léveillé
9a7752b9a6 Finish porting hammer's library to windows
We port registry by importing the (public domain) openbsd implementation
of the tfind/tsearch POSIX binary tree search functions.

These are only necessary when building on non-posix platforms
2016-01-31 17:27:19 +01:00
Nicolas Léveillé
206f5044a8 Remove warning about tail "potentially uninitialized"
MSVC was complaining that the `tail` variable was potentially
uninitialized in the while branch. Since the while loop is actually
coupled to the if (head != NULL) that initializes the tail variable,
we move them together, which makes the warning disappear.
2016-01-31 16:55:17 +01:00
Nicolas Léveillé
2623d1a5f1 Add all remaining parsers that were not compiling on windows
The last file to port for the library is registry.c
2015-12-20 11:51:05 +01:00
Nicolas Léveillé
c5ca35c347 Remove c4388 signed/unsigned mismatch
It is the counterpart to c4018 for x64 compilations.
2015-12-20 11:50:54 +01:00
Nicolas Léveillé
b3a8403b8e Remove more useless MSVC warnings 2015-12-20 11:50:40 +01:00
Sven M. Hallberg
aa1d9b7d25 disable warning on windows about '..' in include paths 2015-12-08 15:38:35 +01:00
Nicolas Léveillé
102b9593dc Update list of files to compile on windows 2015-08-16 16:20:53 +02:00
Nicolas Léveillé
d9ae097533 Remove void pointer arithmetics in system_allocator.c
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.
2015-08-16 09:10:04 +02:00
Nicolas Léveillé
2346239887 Implement h_platform_stopwatch for Windows
We use QueryPerformanceCounter which will return realtime, not user
time.
2015-08-15 15:43:35 +02:00
Nicolas Léveillé
226cad2ab2 Don't build all of Hammer on AppVeyor just now
Since the port is not finished yet, we remove some source files
and the compilation of examples.
2015-08-09 22:46:45 +02:00
Nicolas Léveillé
c0ab06736f Deactivate compiler warnings from CL.EXE that fire in hammer
Some of them are completely spurious however some (marked FIXME(windows))
may benefit from being looked at.
2015-08-09 22:46:45 +02:00
Nicolas Léveillé
6b9ba6033e Allow windows users to include hammer.h
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.
2015-08-09 22:46:00 +02:00
Nicolas Léveillé
e7620e3e4b windows build: Build with debug symbols 2015-08-09 22:46:00 +02:00
Nicolas Léveillé
be30820023 windows build: Add build scripts + appveyor.yml
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)
2015-08-09 22:46:00 +02:00
Dan Hirsch
14a5c5c1ef Test suite now builds 2014-01-04 23:13:35 +01:00
Dan Hirsch
d78cde3830 Added csharp builder to scons 2014-01-04 23:13:35 +01:00
Joe Rozner
dbe0785e2c Remove pyc file 2013-11-20 13:25:09 -08:00
Joe Rozner
f220524b5a Generate pkg-config for Hammer
Create a pkg-config file and install it to $prefix/lib/pkgconfig
2013-11-20 13:04:07 -08:00