mapnik/include/mapnik/global.hpp
Artem Pavlenko 2058f966b2 applied patch from Jochen :
1. The README talks about "scons.py", but it is just called "scons".

2. In demo/c++ there is a Makefile, but the readme.txt gives a command
   line to compile. Both don't work for me. One error can at least be
   fixed by adding -I../../agg/include to the command line.

3. When compiling Mapnik an error is thrown because of a redefined type.
   This was on an Intel 64Bit machine. Fixed by "typedef char byte" to
   "typedef uint8_t byte" in include/mapnik/global.hpp. I am not sure
   whether thats the right fix, though, I just guessed. :-)

4. include/mapnik/image_data.hpp needs
   #include <mapnik/octree.hpp>
   to compile
2007-12-16 12:33:28 +00:00

67 lines
2.3 KiB
C++

/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2006 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
//$Id$
#ifndef GLOBAL_HPP
#define GLOBAL_HPP
#include <boost/cstdint.hpp>
using boost::int32_t;
using boost::uint32_t;
using boost::int16_t;
using boost::uint16_t;
using boost::uint8_t;
namespace mapnik
{
#define int2net(A) (int16_t) (((uint16_t) ((uint8_t) (A)[1])) | \
(((uint16_t) ((uint8_t) (A)[0])) << 8))
#define int4net(A) (int32_t) (((uint32_t) ((uint8_t) (A)[3])) | \
(((uint32_t) ((uint8_t) (A)[2])) << 8) | \
(((uint32_t) ((uint8_t) (A)[1])) << 16) | \
(((uint32_t) ((uint8_t) (A)[0])) << 24))
typedef uint8_t byte;
#define float8net(V,M) do { double def_temp; \
((byte*) &def_temp)[0]=(M)[7]; \
((byte*) &def_temp)[1]=(M)[6]; \
((byte*) &def_temp)[2]=(M)[5]; \
((byte*) &def_temp)[3]=(M)[4]; \
((byte*) &def_temp)[4]=(M)[3]; \
((byte*) &def_temp)[5]=(M)[2]; \
((byte*) &def_temp)[6]=(M)[1]; \
((byte*) &def_temp)[7]=(M)[0]; \
(V) = def_temp; } while(0)
#define float4net(V,M) do { float def_temp; \
((byte*) &def_temp)[0]=(M)[3]; \
((byte*) &def_temp)[1]=(M)[2]; \
((byte*) &def_temp)[2]=(M)[1]; \
((byte*) &def_temp)[3]=(M)[0]; \
(V)=def_temp; } while(0)
}
#endif //GLOBAL_HPP