~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to boost/boost/preprocessor/arithmetic/mul.hpp

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# /* Copyright (C) 2001
 
2
#  * Housemarque Oy
 
3
#  * http://www.housemarque.com
 
4
#  *
 
5
#  * Permission to copy, use, modify, sell and distribute this software is
 
6
#  * granted provided this copyright notice appears in all copies. This
 
7
#  * software is provided "as is" without express or implied warranty, and
 
8
#  * with no claim as to its suitability for any purpose.
 
9
#  */
 
10
#
 
11
# /* Revised by Paul Mensonides (2002) */
 
12
#
 
13
# /* See http://www.boost.org for most recent version. */
 
14
#
 
15
# ifndef BOOST_PREPROCESSOR_ARITHMETIC_MUL_HPP
 
16
# define BOOST_PREPROCESSOR_ARITHMETIC_MUL_HPP
 
17
#
 
18
# include <boost/preprocessor/arithmetic/add.hpp>
 
19
# include <boost/preprocessor/arithmetic/dec.hpp>
 
20
# include <boost/preprocessor/config/config.hpp>
 
21
# include <boost/preprocessor/control/while.hpp>
 
22
# include <boost/preprocessor/tuple/elem.hpp>
 
23
# include <boost/preprocessor/tuple/rem.hpp>
 
24
#
 
25
# /* BOOST_PP_MUL */
 
26
#
 
27
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
 
28
#    define BOOST_PP_MUL(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
 
29
# else
 
30
#    define BOOST_PP_MUL(x, y) BOOST_PP_MUL_I(x, y)
 
31
#    define BOOST_PP_MUL_I(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
 
32
# endif
 
33
#
 
34
# define BOOST_PP_MUL_P(d, rxy) BOOST_PP_TUPLE_ELEM(3, 2, rxy)
 
35
#
 
36
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
 
37
#    define BOOST_PP_MUL_O(d, rxy) BOOST_PP_MUL_O_IM(d, BOOST_PP_TUPLE_REM_3 rxy)
 
38
#    define BOOST_PP_MUL_O_IM(d, im) BOOST_PP_MUL_O_I(d, im)
 
39
# else
 
40
#    define BOOST_PP_MUL_O(d, rxy) BOOST_PP_MUL_O_I(d, BOOST_PP_TUPLE_ELEM(3, 0, rxy), BOOST_PP_TUPLE_ELEM(3, 1, rxy), BOOST_PP_TUPLE_ELEM(3, 2, rxy))
 
41
# endif
 
42
#
 
43
# define BOOST_PP_MUL_O_I(d, r, x, y) (BOOST_PP_ADD_D(d, r, x), x, BOOST_PP_DEC(y))
 
44
#
 
45
# /* BOOST_PP_MUL_D */
 
46
#
 
47
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
 
48
#    define BOOST_PP_MUL_D(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
 
49
# else
 
50
#    define BOOST_PP_MUL_D(d, x, y) BOOST_PP_MUL_D_I(d, x, y)
 
51
#    define BOOST_PP_MUL_D_I(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
 
52
# endif
 
53
#
 
54
# endif