Skip to content

Commit 4eb578a

Browse files
committed
Use STDLIB_BITSET == 1
1 parent 7b1b1ea commit 4eb578a

File tree

6 files changed

+23
-22
lines changed

6 files changed

+23
-22
lines changed

example/math/example_math_swap.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ program example_math_swap
4444
call swap(x,y)
4545
end block
4646

47-
#ifdef STDLIB_BITSET
47+
#if STDLIB_BITSET == 1
4848
block
4949
use stdlib_bitsets
5050
type(bitset_64) :: x, y

include/macros.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
!Default: compile the bitset module
33
#ifdef STDLIB_NO_BITSET
4+
#define STDLIB_BITSET 0
45
#else
5-
#define STDLIB_BITSET
6+
#define STDLIB_BITSET 1
67
#endif

src/stdlib_math.fypp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module stdlib_math
66
use stdlib_kinds, only: int8, int16, int32, int64, sp, dp, xdp, qp
77
use stdlib_optval, only: optval
8-
#ifdef STDLIB_BITSET
8+
#if STDLIB_BITSET == 1
99
use stdlib_bitsets, only: bitset_64, bitset_large
1010
#endif
1111

src/stdlib_sorting.fypp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ module stdlib_sorting
135135
use stdlib_string_type, only: string_type, assignment(=), operator(>), &
136136
operator(>=), operator(<), operator(<=)
137137

138-
#ifdef STDLIB_BITSET
138+
#if STDLIB_BITSET == 1
139139
use stdlib_bitsets, only: bitset_64, bitset_large, &
140140
assignment(=), operator(>), operator(>=), operator(<), operator(<=)
141141
#endif

test/math/test_stdlib_math.fypp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ contains
370370
if (allocated(error)) return
371371
end subroutine test_swap_stt
372372

373-
#ifdef STDLIB_BITSET
373+
#if STDLIB_BITSET == 1
374374
subroutine test_swap_bitset_64(error)
375375
use stdlib_bitsets
376376
type(error_type), allocatable, intent(out) :: error

test/sorting/test_sorting.fypp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module test_sorting
1212
use stdlib_sorting, only: sort, sort_index, sort_adjoint, ord_sort, radix_sort, int_index, int_index_low
1313
use stdlib_string_type, only: string_type, assignment(=), operator(>), &
1414
operator(<), write(formatted)
15-
#ifdef STDLIB_BITSET
15+
#if STDLIB_BITSET == 1
1616
use stdlib_bitsets, only: bitset_64, bitset_large, &
1717
assignment(=), operator(>), operator(<)
1818
#endif
@@ -25,7 +25,7 @@ module test_sorting
2525
integer(int32), parameter :: test_size = 2_int32**test_power
2626
integer(int32), parameter :: char_size = char_set_size**4
2727
integer(int32), parameter :: string_size = char_set_size**3
28-
#ifdef STDLIB_BITSET
28+
#if STDLIB_BITSET == 1
2929
integer(int32), parameter :: bitset_size = char_set_size**3
3030
#endif
3131
integer(int32), parameter :: block_size = test_size/6
@@ -50,7 +50,7 @@ module test_sorting
5050
string_decrease(0:string_size-1), &
5151
string_increase(0:string_size-1), &
5252
string_rand(0:string_size-1)
53-
#ifdef STDLIB_BITSET
53+
#if STDLIB_BITSET == 1
5454
type(bitset_large) :: &
5555
bitsetl_decrease(0:bitset_size-1), &
5656
bitsetl_increase(0:bitset_size-1), &
@@ -65,7 +65,7 @@ module test_sorting
6565
real(sp) :: real_dummy(0:test_size-1)
6666
character(len=4) :: char_dummy(0:char_size-1)
6767
type(string_type) :: string_dummy(0:string_size-1)
68-
#ifdef STDLIB_BITSET
68+
#if STDLIB_BITSET == 1
6969
type(bitset_large) :: bitsetl_dummy(0:bitset_size-1)
7070
type(bitset_64) :: bitset64_dummy(0:bitset_size-1)
7171
#endif
@@ -74,7 +74,7 @@ module test_sorting
7474
integer(int32) :: work(0:test_size/2-1)
7575
character(len=4) :: char_work(0:char_size/2-1)
7676
type(string_type) :: string_work(0:string_size/2-1)
77-
#ifdef STDLIB_BITSET
77+
#if STDLIB_BITSET == 1
7878
type(bitset_large) :: bitsetl_work(0:bitset_size/2-1)
7979
type(bitset_64) :: bitset64_work(0:bitset_size/2-1)
8080
#endif
@@ -88,7 +88,7 @@ module test_sorting
8888
integer :: lun
8989
character(len=4) :: char_temp
9090
type(string_type) :: string_temp
91-
#ifdef STDLIB_BITSET
91+
#if STDLIB_BITSET == 1
9292
type(bitset_large) :: bitsetl_temp
9393
type(bitset_64) :: bitset64_temp
9494
#endif
@@ -106,7 +106,7 @@ contains
106106
testsuite = [ &
107107
new_unittest('char_ord_sorts', test_char_ord_sorts), &
108108
new_unittest('string_ord_sorts', test_string_ord_sorts), &
109-
#ifdef STDLIB_BITSET
109+
#if STDLIB_BITSET == 1
110110
new_unittest('bitset_large_ord_sorts', test_bitsetl_ord_sorts), &
111111
new_unittest('bitset_64_ord_sorts', test_bitset64_ord_sorts), &
112112
#endif
@@ -115,15 +115,15 @@ contains
115115
new_unittest('int_sorts', test_int_sorts), &
116116
new_unittest('char_sorts', test_char_sorts), &
117117
new_unittest('string_sorts', test_string_sorts), &
118-
#ifdef STDLIB_BITSET
118+
#if STDLIB_BITSET == 1
119119
new_unittest('bitset_large_sorts', test_bitsetl_sorts), &
120120
new_unittest('bitset_64_sorts', test_bitset64_sorts), &
121121
#endif
122122
#:for ki, ti, namei in INT_INDEX_TYPES_ALT_NAME
123123
new_unittest('int_sort_indexes_${namei}$', test_int_sort_indexes_${namei}$), &
124124
new_unittest('char_sort_indexes_${namei}$', test_char_sort_indexes_${namei}$), &
125125
new_unittest('string_sort_indexes_${namei}$', test_string_sort_indexes_${namei}$), &
126-
#ifdef STDLIB_BITSET
126+
#if STDLIB_BITSET == 1
127127
new_unittest('bitset_large_sort_indexes_${namei}$', test_bitsetl_sort_indexes_${namei}$), &
128128
new_unittest('bitset_64_sort_indexes_${namei}$', test_bitset64_sort_indexes_${namei}$), &
129129
#endif
@@ -132,7 +132,7 @@ contains
132132
new_unittest('int_sort_adjointes_${namei}$', test_int_sort_adjointes_${namei}$), &
133133
new_unittest('char_sort_adjointes_${namei}$', test_char_sort_adjointes_${namei}$), &
134134
new_unittest('string_sort_adjointes_${namei}$', test_string_sort_adjointes_${namei}$), &
135-
#ifdef STDLIB_BITSET
135+
#if STDLIB_BITSET == 1
136136
new_unittest('bitset_large_sort_adjointes_${namei}$', test_bitsetl_sort_adjointes_${namei}$), &
137137
new_unittest('bitset_64_sort_adjointes_${namei}$', test_bitset64_sort_adjointes_${namei}$), &
138138
#endif
@@ -240,7 +240,7 @@ contains
240240
string_rand(index1) = string_temp
241241
end do
242242

243-
#ifdef STDLIB_BITSET
243+
#if STDLIB_BITSET == 1
244244
do i = 0, bitset_size-1
245245
write(bin32,'(b32.32)') i
246246
call bitsetl_increase(i)%from_string(bin32)
@@ -556,7 +556,7 @@ contains
556556

557557
end subroutine test_string_ord_sort
558558

559-
#ifdef STDLIB_BITSET
559+
#if STDLIB_BITSET == 1
560560
subroutine test_bitsetl_ord_sorts(error)
561561
!> Error handling
562562
type(error_type), allocatable, intent(out) :: error
@@ -1113,7 +1113,7 @@ contains
11131113

11141114
end subroutine test_string_sort
11151115

1116-
#ifdef STDLIB_BITSET
1116+
#if STDLIB_BITSET == 1
11171117
subroutine test_bitsetl_sorts(error)
11181118
!> Error handling
11191119
type(error_type), allocatable, intent(out) :: error
@@ -1467,7 +1467,7 @@ contains
14671467

14681468
end subroutine test_string_sort_index_${namei}$
14691469

1470-
#ifdef STDLIB_BITSET
1470+
#if STDLIB_BITSET == 1
14711471
subroutine test_bitsetl_sort_indexes_${namei}$(error)
14721472
!> Error handling
14731473
type(error_type), allocatable, intent(out) :: error
@@ -1807,7 +1807,7 @@ contains
18071807

18081808
end subroutine test_string_sort_adjoint_${namei}$
18091809

1810-
#ifdef STDLIB_BITSET
1810+
#if STDLIB_BITSET == 1
18111811
subroutine test_bitsetl_sort_adjointes_${namei}$(error)
18121812
!> Error handling
18131813
type(error_type), allocatable, intent(out) :: error
@@ -2108,7 +2108,7 @@ contains
21082108

21092109
end subroutine verify_string_sort
21102110

2111-
#ifdef STDLIB_BITSET
2111+
#if STDLIB_BITSET == 1
21122112
subroutine verify_bitsetl_sort( a, valid, i )
21132113
type(bitset_large), intent(in) :: a(0:)
21142114
logical, intent(out) :: valid
@@ -2222,7 +2222,7 @@ contains
22222222

22232223
end subroutine verify_string_reverse_sort
22242224

2225-
#ifdef STDLIB_BITSET
2225+
#if STDLIB_BITSET == 1
22262226
subroutine verify_bitsetl_reverse_sort( a, valid, i )
22272227
type(bitset_large), intent(in) :: a(0:)
22282228
logical, intent(out) :: valid

0 commit comments

Comments
 (0)