AmigaOS port of Boost 1.27.0

I've started porting Boost 1.27.0 to AmigaOS for use in a project of mine and I have a few additions and diffs to contribute. I've created a platform file so other AmigaOS users can at least start using the Boost out of the box. 1) boost/config/platform/amigaos.h // (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and // distribute this software is granted provided this copyright notice appears // in all copies. This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // See http://www.boost.org for most recent version. #define BOOST_PLATFORM "AmigaOS" #define BOOST_DISABLE_THREADS #define BOOST_NO_CWCHAR #define BOOST_NO_CWCTYPE #define BOOST_NO_STD_WSTRING #define BOOST_NO_SWPRINTF #define BOOST_NO_INTRINSIC_WCHAR_T 2) boost/config/select_platform_config.hpp *** select_platform_config.hpp Thu Feb 07 08:26:04 2002 --- GG:boost/boost/config/select_platform_config.hpp Sat Mar 23 21:54:42 2002 *************** *** 52,57 **** --- 52,61 ---- // IBM # define BOOST_PLATFORM_CONFIG "boost/config/platform/aix.hpp" + #elif defined(__amigaos__) + // AmigaOS + # define BOOST_PLATFORM_CONFIG "boost/config/platform/amigaos.hpp" + #else # if defined(unix) \ 3) libs/graph/test/isomorphism.cpp *** isomorphism.cpp Sun Mar 24 08:23:13 2002 --- Code:Projects/Tests/GCC/boost/isomorphism.cpp Sun Mar 24 10:09:38 2002 *************** *** 36,71 **** using namespace boost; - // Verify that the given mapping iso_map from the vertices of g1 to the - // vertices of g2 describes an isomorphism. - // Note: this could be made much faster by specializing based on the graph - // concepts modeled, but since we're verifying an O(n^(lg n)) algorithm, - // O(n^4) won't hurt us. - template<typename Graph1, typename Graph2, typename IsoMap> - inline bool verify_isomorphism(const Graph1& g1, const Graph2& g2, - IsoMap iso_map) - { - if (num_vertices(g1) != num_vertices(g2) || num_edges(g1) != num_edges(g2)) - return false; - - for (typename graph_traits<Graph1>::edge_iterator e1 = edges(g1).first; - e1 != edges(g1).second; ++e1) { - bool found_edge = false; - for (typename graph_traits<Graph2>::edge_iterator e2 = edges(g2).first; - e2 != edges(g2).second && !found_edge; ++e2) { - if (source(*e2, g2) == get(iso_map, source(*e1, g1)) && - target(*e2, g2) == get(iso_map, target(*e1, g1))) { - found_edge = true; - } - } - - if (!found_edge) - return false; - } - - return true; - } - template <typename Generator> struct random_functor { random_functor(Generator& g) : g(g) { } --- 36,41 ---- 4) boost/property_map.hpp *** property_map.hpp Thu Feb 07 08:25:53 2002 --- GG:boost/boost/property_map.hpp Sun Mar 24 07:55:02 2002 *************** *** 7,12 **** --- 7,13 ---- #ifndef BOOST_PROPERTY_MAP_HPP #define BOOST_PROPERTY_MAP_HPP + #include <cassert> #include <iterator> #include <boost/config.hpp> #include <boost/pending/cstddef.hpp> 5) boost/graph/vector_as_graph.hpp *** vector_as_graph.hpp Thu Feb 07 08:26:31 2002 --- GG:boost/boost/graph/vector_as_graph.hpp Sun Mar 24 08:51:08 2002 *************** *** 35,40 **** --- 35,41 ---- #ifndef BOOST_VECTOR_AS_GRAPH_HPP #define BOOST_VECTOR_AS_GRAPH_HPP + #include <cassert> #include <utility> #include <vector> #include <boost/iterator.hpp> So far, I've only tested the following libraries: graph - some minor fixes needed random - no changes required shared_ptr - no changes required NOTE: I'm using GCC 2.95.3 and STLport 4.5.3 (SGI I/O streams) as a base on AmigaOS 3.9 with Boing Bag 2. Enjoy!

On Sunday, March 24, 2002, at 09:29 AM, Steven Solie wrote:
I've started porting Boost 1.27.0 to AmigaOS for use in a project of mine and I have a few additions and diffs to contribute. I've created a platform file so other AmigaOS users can at least start using the Boost out of the box.
That's great! I assume John Maddock will put these changes into boost/config, but I'm available to help if need be. I can probably deal with the missing assert includes.
#define BOOST_DISABLE_THREADS
The BOOST_DISABLE_THREADS define shouldn't be set for a platform. If the platform doesn't have threads, we just don't define BOOST_HAS_THREADS for that platform. So you shouldn't need this line. If you do need it, can you explain why?
#define BOOST_NO_CWCHAR #define BOOST_NO_CWCTYPE #define BOOST_NO_SWPRINTF
You only have to define BOOST_NO_CWCHAR. If it's defined, BOOST_NO_CWCTYPE and BOOST_NO_SWPRINTF are both defined for you by suffix.hpp. This should be in the documentation, but perhaps it's not.
#define BOOST_NO_INTRINSIC_WCHAR_T
This is usually a property of the compiler, not the platform, and so it's the responsibility of the boost/config/compiler/xxx.hpp file to set this. But I see that you're using GCC 2.95.3. I think that GCC 2.95.3 does have an intrinsic wchar_t. What's going on here.
3) libs/graph/test/isomorphism.cpp
- inline bool verify_isomorphism(const Graph1& g1, const Graph2& g2,
I'm not sure why you removed this function template. It's used in test_isomorphism below. Could you elaborate?
+ #include <cassert>
Since <cassert> and <assert.h> are identical and some platforms lack <cassert> we might want to use <assert.h> here even though it's a deprecated feature. -- Darin

--- In Boost-Users@y..., Darin Adler <darin@b...> wrote:
The BOOST_DISABLE_THREADS define shouldn't be set for a platform. If the platform doesn't have threads, we just don't define BOOST_HAS_THREADS for that platform. So you shouldn't need this line. If you do need it, can you explain why?
I defined BOOST_DISABLE_THREADS because AmigaOS does not support multithreading and I assumed the opposite (threads enabled) was the default.
#define BOOST_NO_CWCHAR #define BOOST_NO_CWCTYPE #define BOOST_NO_SWPRINTF
You only have to define BOOST_NO_CWCHAR.
I'll try removing BOOST_NO_CWCTYPE and BOOST_NO_SWPRINTF. I went through the "Boost Macro Reference" and picked off all the definitions I thought applied. If there are dependencies between the definitions, I didn't see them.
#define BOOST_NO_INTRINSIC_WCHAR_T
This is usually a property of the compiler, not the platform, and so it's the responsibility of the boost/config/compiler/xxx.hpp file to set this. But I see that you're using GCC 2.95.3. I think that GCC 2.95.3 does have an intrinsic wchar_t. What's going on here.
I hit this problem in boost/integer_traits.hpp line 109. The message "No WCHAR_MIN and WCHAR_MAX present, please adjust integer_traits<> for your compiler." appeared when I tried to compile the graph library regression test suite. Either GCC 2.95.3 doesn't support intrinsic wchar_t or the AmigaOS port of GCC 2.95.3 doesn't. I suspect the AmigaOS port has been modified to remove the intrinsic wchar_t support. I'll ask on the Amiga GCC mailing list and see if anyone knows for sure.
3) libs/graph/test/isomorphism.cpp
- inline bool verify_isomorphism(const Graph1& g1, const Graph2& g2,
I'm not sure why you removed this function template. It's used in test_isomorphism below. Could you elaborate?
That template is already defined in boost/graph/isomorphism.hpp starting on line 394. Looks like a possible cut & paste error to me.
+ #include <cassert>
Since <cassert> and <assert.h> are identical and some platforms lack <cassert> we might want to use <assert.h> here even though it's a deprecated feature.
Here's a list of files that include <assert.h>: ./assert.hpp ./compatibility/cpp_c_headers/cassert ./graph/graph_utility.hpp Here's a list of files that include <cassert>: ./graph/adjacency_matrix.hpp ./graph/detail/bitset.hpp ./graph/minimum_degree_ordering.hpp ./graph/properties.hpp ./graph/push_relabel_max_flow.hpp ./graph/subgraph.hpp ./min_rand.hpp ./pending/bucket_sorter.hpp ./random/bernoulli_distribution.hpp ./random/detail/const_mod.hpp ./random/exponential_distribution.hpp ./random/geometric_distribution.hpp ./random/inversive_congruential.hpp ./random/linear_congruential.hpp ./random/lognormal_distribution.hpp ./random/normal_distribution.hpp ./random/shuffle_output.hpp ./random/triangle_distribution.hpp ./random/uniform_int.hpp ./random/uniform_real.hpp ./random/uniform_smallint.hpp ./regex/detail/fileiter.hpp ./tokenizer.hpp ./token_functions.hpp It seems that the majority is using <cassert> so I think it is safe to assume it will work for everyone. Note: My lists may not be exhaustive because I just did a simple grep.
participants (3)
-
Darin Adler
-
smsolie
-
Steven Solie