bit-twiddle 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: df07a55110e5af925bd93744a433285027625484
4
- data.tar.gz: 83f5c1bc321432ca3e02337ed9753211059aafaa
2
+ SHA256:
3
+ metadata.gz: ea6d4c9db54e566dc5c8a45e8ab95a41fec390f45358092351967501a4248d9c
4
+ data.tar.gz: f25c14b7aaba7912a12e77e79f1ad4542d6f13d8ac36c2ef85a3f9bc83589908
5
5
  SHA512:
6
- metadata.gz: de3c177b4ca0b61c0b1382c9cff137bca48c6fe3cf8195390448e4e34e80c1eb4907359598201c476e87d34681bb24900d38258089ec86ae7fbb7a4cee56c085
7
- data.tar.gz: 10813e14ff47ce9a9f7352fd0b800f499320779563421cd078fb3c8463ba96c0cdc970e30f4b02815eedab118dcd326544146513dbd1c3da45ddea3397e93580
6
+ metadata.gz: 276b6e1717614ef408cc52275612aa78cc3ef17fcb46d77771ff433d0cb6f26f976b30efcb97a9c1fabedd6fbeafa850edbce322e475db512d6d902d9adaefc2
7
+ data.tar.gz: ce967635d56d3b9425e6036a242cb87da2995a261b703b6c6024776df02a5c1dd30e68d74cc12c28bbbea7672cdd3851eb10af497b302e4ca4306f1fbc2653d2
data/LICENSE CHANGED
@@ -1,3 +1,3 @@
1
1
  The program code in the 'bit-twiddle' repository (currently available at https://github.com/alexdowad/bit-twiddle) has been placed in the public domain by its author. You can do anything you want with it, anything at all. You can copy it, sell it, buy it, lease it, rent it out, put it in pawn, or use it as a down payment on a new truck. You can sing it out in the shower, or on a crowded bus. You can even inscribe it on a silk flag, and plant it on Kilimanjaro's snow-covered slopes. The possibilities are endless!
2
2
 
3
- If you need a specific license, then make a copy of the code, solemnly declare that the copy belongs to you, and license it to yourself under any terms you desire.
3
+ If 'public domain' isn't what you like, then you can use this code under a CC0 (creative commons) license. Still no good? Drop the author a note and we'll see how to fix you up.
@@ -0,0 +1,266 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ # V=0 quiet, V=1 verbose. other values don't work.
5
+ V = 0
6
+ Q1 = $(V:1=)
7
+ Q = $(Q1:0=@)
8
+ ECHO1 = $(V:1=@ :)
9
+ ECHO = $(ECHO1:0=@ echo)
10
+ NULLCMD = :
11
+
12
+ #### Start of system configuration section. ####
13
+
14
+ srcdir = .
15
+ topdir = /home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0
16
+ hdrdir = $(topdir)
17
+ arch_hdrdir = /home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux
18
+ PATH_SEPARATOR = :
19
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
20
+ prefix = $(DESTDIR)/home/alex/.rbenv/versions/2.7.2
21
+ rubysitearchprefix = $(rubylibprefix)/$(sitearch)
22
+ rubyarchprefix = $(rubylibprefix)/$(arch)
23
+ rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
24
+ exec_prefix = $(prefix)
25
+ vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
26
+ sitearchhdrdir = $(sitehdrdir)/$(sitearch)
27
+ rubyarchhdrdir = $(rubyhdrdir)/$(arch)
28
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
29
+ sitehdrdir = $(rubyhdrdir)/site_ruby
30
+ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
31
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
32
+ vendorlibdir = $(vendordir)/$(ruby_version)
33
+ vendordir = $(rubylibprefix)/vendor_ruby
34
+ sitearchdir = $(sitelibdir)/$(sitearch)
35
+ sitelibdir = $(sitedir)/$(ruby_version)
36
+ sitedir = $(rubylibprefix)/site_ruby
37
+ rubyarchdir = $(rubylibdir)/$(arch)
38
+ rubylibdir = $(rubylibprefix)/$(ruby_version)
39
+ sitearchincludedir = $(includedir)/$(sitearch)
40
+ archincludedir = $(includedir)/$(arch)
41
+ sitearchlibdir = $(libdir)/$(sitearch)
42
+ archlibdir = $(libdir)/$(arch)
43
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
44
+ mandir = $(datarootdir)/man
45
+ localedir = $(datarootdir)/locale
46
+ libdir = $(exec_prefix)/lib
47
+ psdir = $(docdir)
48
+ pdfdir = $(docdir)
49
+ dvidir = $(docdir)
50
+ htmldir = $(docdir)
51
+ infodir = $(datarootdir)/info
52
+ docdir = $(datarootdir)/doc/$(PACKAGE)
53
+ oldincludedir = $(DESTDIR)/usr/include
54
+ includedir = $(prefix)/include
55
+ runstatedir = $(localstatedir)/run
56
+ localstatedir = $(prefix)/var
57
+ sharedstatedir = $(prefix)/com
58
+ sysconfdir = $(prefix)/etc
59
+ datadir = $(datarootdir)
60
+ datarootdir = $(prefix)/share
61
+ libexecdir = $(exec_prefix)/libexec
62
+ sbindir = $(exec_prefix)/sbin
63
+ bindir = $(exec_prefix)/bin
64
+ archdir = $(rubyarchdir)
65
+
66
+
67
+ CC_WRAPPER =
68
+ CC = gcc
69
+ CXX = g++
70
+ LIBRUBY = $(LIBRUBY_SO)
71
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
72
+ LIBRUBYARG_SHARED = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)
73
+ LIBRUBYARG_STATIC = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static $(MAINLIBS)
74
+ empty =
75
+ OUTFLAG = -o $(empty)
76
+ COUTFLAG = -o $(empty)
77
+ CSRCFLAG = $(empty)
78
+
79
+ RUBY_EXTCONF_H =
80
+ cflags = $(optflags) $(debugflags) $(warnflags)
81
+ cxxflags =
82
+ optflags = -O3
83
+ debugflags = -ggdb3
84
+ warnflags = -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable
85
+ cppflags =
86
+ CCDLFLAGS = -fPIC
87
+ CFLAGS = $(CCDLFLAGS) $(cflags) -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 $(ARCH_FLAG)
88
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
89
+ DEFS =
90
+ CPPFLAGS = -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DSIZEOF_LONG_LONG=8 -DHAVE_TYPE_ULONG -DRSHIFT_IS_ARITH=1 -DHAVE_BSWAP16=1 -I/home/alex/.rbenv/versions/2.7.2/include $(DEFS) $(cppflags)
91
+ CXXFLAGS = $(CCDLFLAGS) -g -O2 $(ARCH_FLAG)
92
+ ldflags = -L. -L/home/alex/.rbenv/versions/2.7.2/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic
93
+ dldflags = -L/home/alex/.rbenv/versions/2.7.2/lib -Wl,--compress-debug-sections=zlib
94
+ ARCH_FLAG =
95
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
96
+ LDSHARED = $(CC) -shared
97
+ LDSHAREDXX = $(CXX) -shared
98
+ AR = ar
99
+ EXEEXT =
100
+
101
+ RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
102
+ RUBY_SO_NAME = ruby
103
+ RUBYW_INSTALL_NAME =
104
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
105
+ RUBYW_BASE_NAME = rubyw
106
+ RUBY_BASE_NAME = ruby
107
+
108
+ arch = x86_64-linux
109
+ sitearch = $(arch)
110
+ ruby_version = 2.7.0
111
+ ruby = $(bindir)/$(RUBY_BASE_NAME)
112
+ RUBY = $(ruby)
113
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
114
+
115
+ RM = rm -f
116
+ RM_RF = $(RUBY) -run -e rm -- -rf
117
+ RMDIRS = rmdir --ignore-fail-on-non-empty -p
118
+ MAKEDIRS = /bin/mkdir -p
119
+ INSTALL = /usr/bin/install -c
120
+ INSTALL_PROG = $(INSTALL) -m 0755
121
+ INSTALL_DATA = $(INSTALL) -m 644
122
+ COPY = cp
123
+ TOUCH = exit >
124
+
125
+ #### End of system configuration section. ####
126
+
127
+ preload =
128
+ libpath = . $(libdir)
129
+ LIBPATH = -L. -L$(libdir) -Wl,-rpath,$(libdir)
130
+ DEFFILE =
131
+
132
+ CLEANFILES = mkmf.log
133
+ DISTCLEANFILES =
134
+ DISTCLEANDIRS =
135
+
136
+ extout =
137
+ extout_prefix =
138
+ target_prefix =
139
+ LOCAL_LIBS =
140
+ LIBS = $(LIBRUBYARG_SHARED) -lm -lc
141
+ ORIG_SRCS = bit_twiddle.c
142
+ SRCS = $(ORIG_SRCS)
143
+ OBJS = bit_twiddle.o
144
+ HDRS =
145
+ LOCAL_HDRS =
146
+ TARGET = bit_twiddle
147
+ TARGET_NAME = bit_twiddle
148
+ TARGET_ENTRY = Init_$(TARGET_NAME)
149
+ DLLIB = $(TARGET).so
150
+ EXTSTATIC =
151
+ STATIC_LIB =
152
+
153
+ TIMESTAMP_DIR = .
154
+ BINDIR = $(bindir)
155
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
156
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
157
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
158
+ HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
159
+ ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
160
+ TARGET_SO_DIR =
161
+ TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
162
+ CLEANLIBS = $(TARGET_SO)
163
+ CLEANOBJS = *.o *.bak
164
+
165
+ all: $(DLLIB)
166
+ static: $(STATIC_LIB)
167
+ .PHONY: all install static install-so install-rb
168
+ .PHONY: clean clean-so clean-static clean-rb
169
+
170
+ clean-static::
171
+ clean-rb-default::
172
+ clean-rb::
173
+ clean-so::
174
+ clean: clean-so clean-static clean-rb-default clean-rb
175
+ -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
176
+
177
+ distclean-rb-default::
178
+ distclean-rb::
179
+ distclean-so::
180
+ distclean-static::
181
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
182
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
183
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
184
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
185
+
186
+ realclean: distclean
187
+ install: install-so install-rb
188
+
189
+ install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.time
190
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
191
+ clean-static::
192
+ -$(Q)$(RM) $(STATIC_LIB)
193
+ install-rb: pre-install-rb do-install-rb install-rb-default
194
+ install-rb-default: pre-install-rb-default do-install-rb-default
195
+ pre-install-rb: Makefile
196
+ pre-install-rb-default: Makefile
197
+ do-install-rb:
198
+ do-install-rb-default:
199
+ pre-install-rb-default:
200
+ @$(NULLCMD)
201
+ $(TIMESTAMP_DIR)/.sitearchdir.time:
202
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
203
+ $(Q) $(TOUCH) $@
204
+
205
+ site-install: site-install-so site-install-rb
206
+ site-install-so: install-so
207
+ site-install-rb: install-rb
208
+
209
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
210
+
211
+ .cc.o:
212
+ $(ECHO) compiling $(<)
213
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
214
+
215
+ .cc.S:
216
+ $(ECHO) translating $(<)
217
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
218
+
219
+ .mm.o:
220
+ $(ECHO) compiling $(<)
221
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
222
+
223
+ .mm.S:
224
+ $(ECHO) translating $(<)
225
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
226
+
227
+ .cxx.o:
228
+ $(ECHO) compiling $(<)
229
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
230
+
231
+ .cxx.S:
232
+ $(ECHO) translating $(<)
233
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
234
+
235
+ .cpp.o:
236
+ $(ECHO) compiling $(<)
237
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
238
+
239
+ .cpp.S:
240
+ $(ECHO) translating $(<)
241
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
242
+
243
+ .c.o:
244
+ $(ECHO) compiling $(<)
245
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
246
+
247
+ .c.S:
248
+ $(ECHO) translating $(<)
249
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
250
+
251
+ .m.o:
252
+ $(ECHO) compiling $(<)
253
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
254
+
255
+ .m.S:
256
+ $(ECHO) translating $(<)
257
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
258
+
259
+ $(TARGET_SO): $(OBJS) Makefile
260
+ $(ECHO) linking shared-object $(DLLIB)
261
+ -$(Q)$(RM) $(@)
262
+ $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
263
+
264
+
265
+
266
+ $(OBJS): $(HDRS) $(ruby_headers)
Binary file
Binary file
@@ -20,8 +20,10 @@ if RUBY_ENGINE == 'rbx'
20
20
  raise "bit-twiddle does not support Rubinius. Sorry!"
21
21
  elsif RUBY_VERSION < '2.3.0'
22
22
  $CFLAGS << " -I#{File.join(dir, 'ruby22')} "
23
- else
23
+ elsif RUBY_VERSION < '3.0.0'
24
24
  $CFLAGS << " -I#{File.join(dir, 'ruby23')} "
25
+ else
26
+ $CFLAGS << " -I#{File.join(dir, 'ruby30')} "
25
27
  end
26
28
 
27
29
  check_sizeof 'short'
@@ -0,0 +1,270 @@
1
+ check_sizeof: checking size of short... -------------------- 2
2
+
3
+ "gcc -o conftest -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 conftest.c -L. -L/home/alex/.rbenv/versions/2.7.2/lib -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L. -L/home/alex/.rbenv/versions/2.7.2/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L/home/alex/.rbenv/versions/2.7.2/lib -lruby -lm -lc"
4
+ checked program was:
5
+ /* begin */
6
+ 1: #include "ruby.h"
7
+ 2:
8
+ 3: int main(int argc, char **argv)
9
+ 4: {
10
+ 5: return !!argv[argc];
11
+ 6: }
12
+ /* end */
13
+
14
+ "gcc -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 -c conftest.c"
15
+ conftest.c:7:5: error: size of array ‘conftest_const’ is negative
16
+ 7 | int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
17
+ | ^~~~~~~~~~~~~~
18
+ cc1: error: unrecognized command line option ‘-Wno-unknown-attributes’ [-Werror]
19
+ cc1: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
20
+ cc1: error: unrecognized command line option ‘-Wno-self-assign’ [-Werror]
21
+ cc1: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
22
+ cc1: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
23
+ cc1: all warnings being treated as errors
24
+ checked program was:
25
+ /* begin */
26
+ 1: #include "ruby.h"
27
+ 2:
28
+ 3: typedef short rbcv_typedef_;
29
+ 4: rbcv_typedef_ *rbcv_ptr_;
30
+ 5:
31
+ 6: /*top*/
32
+ 7: int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
33
+ /* end */
34
+
35
+ "gcc -o conftest -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 conftest.c -L. -L/home/alex/.rbenv/versions/2.7.2/lib -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L. -L/home/alex/.rbenv/versions/2.7.2/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L/home/alex/.rbenv/versions/2.7.2/lib -lruby -lm -lc"
36
+ checked program was:
37
+ /* begin */
38
+ 1: #include "ruby.h"
39
+ 2:
40
+ 3: typedef short rbcv_typedef_;
41
+ 4: rbcv_typedef_ *rbcv_ptr_;
42
+ 5:
43
+ 6: #include <stdio.h>
44
+ 7: /*top*/
45
+ 8: typedef unsigned
46
+ 9: #ifdef PRI_LL_PREFIX
47
+ 10: #define PRI_CONFTEST_PREFIX PRI_LL_PREFIX
48
+ 11: LONG_LONG
49
+ 12: #else
50
+ 13: #define PRI_CONFTEST_PREFIX "l"
51
+ 14: long
52
+ 15: #endif
53
+ 16: conftest_type;
54
+ 17: conftest_type conftest_const = (conftest_type)(sizeof((*rbcv_ptr_)));
55
+ 18: int main() {printf("%"PRI_CONFTEST_PREFIX"u\n", conftest_const); return 0;}
56
+ /* end */
57
+
58
+ ./conftest |
59
+ --------------------
60
+
61
+ check_sizeof: checking size of int... -------------------- 4
62
+
63
+ "gcc -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 -c conftest.c"
64
+ conftest.c:7:5: error: size of array ‘conftest_const’ is negative
65
+ 7 | int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
66
+ | ^~~~~~~~~~~~~~
67
+ cc1: error: unrecognized command line option ‘-Wno-unknown-attributes’ [-Werror]
68
+ cc1: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
69
+ cc1: error: unrecognized command line option ‘-Wno-self-assign’ [-Werror]
70
+ cc1: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
71
+ cc1: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
72
+ cc1: all warnings being treated as errors
73
+ checked program was:
74
+ /* begin */
75
+ 1: #include "ruby.h"
76
+ 2:
77
+ 3: typedef int rbcv_typedef_;
78
+ 4: rbcv_typedef_ *rbcv_ptr_;
79
+ 5:
80
+ 6: /*top*/
81
+ 7: int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
82
+ /* end */
83
+
84
+ "gcc -o conftest -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 conftest.c -L. -L/home/alex/.rbenv/versions/2.7.2/lib -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L. -L/home/alex/.rbenv/versions/2.7.2/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L/home/alex/.rbenv/versions/2.7.2/lib -lruby -lm -lc"
85
+ checked program was:
86
+ /* begin */
87
+ 1: #include "ruby.h"
88
+ 2:
89
+ 3: typedef int rbcv_typedef_;
90
+ 4: rbcv_typedef_ *rbcv_ptr_;
91
+ 5:
92
+ 6: #include <stdio.h>
93
+ 7: /*top*/
94
+ 8: typedef unsigned
95
+ 9: #ifdef PRI_LL_PREFIX
96
+ 10: #define PRI_CONFTEST_PREFIX PRI_LL_PREFIX
97
+ 11: LONG_LONG
98
+ 12: #else
99
+ 13: #define PRI_CONFTEST_PREFIX "l"
100
+ 14: long
101
+ 15: #endif
102
+ 16: conftest_type;
103
+ 17: conftest_type conftest_const = (conftest_type)(sizeof((*rbcv_ptr_)));
104
+ 18: int main() {printf("%"PRI_CONFTEST_PREFIX"u\n", conftest_const); return 0;}
105
+ /* end */
106
+
107
+ ./conftest |
108
+ --------------------
109
+
110
+ check_sizeof: checking size of long... -------------------- 8
111
+
112
+ "gcc -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 -c conftest.c"
113
+ conftest.c:7:5: error: size of array ‘conftest_const’ is negative
114
+ 7 | int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
115
+ | ^~~~~~~~~~~~~~
116
+ cc1: error: unrecognized command line option ‘-Wno-unknown-attributes’ [-Werror]
117
+ cc1: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
118
+ cc1: error: unrecognized command line option ‘-Wno-self-assign’ [-Werror]
119
+ cc1: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
120
+ cc1: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
121
+ cc1: all warnings being treated as errors
122
+ checked program was:
123
+ /* begin */
124
+ 1: #include "ruby.h"
125
+ 2:
126
+ 3: typedef long rbcv_typedef_;
127
+ 4: rbcv_typedef_ *rbcv_ptr_;
128
+ 5:
129
+ 6: /*top*/
130
+ 7: int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
131
+ /* end */
132
+
133
+ "gcc -o conftest -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 conftest.c -L. -L/home/alex/.rbenv/versions/2.7.2/lib -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L. -L/home/alex/.rbenv/versions/2.7.2/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L/home/alex/.rbenv/versions/2.7.2/lib -lruby -lm -lc"
134
+ checked program was:
135
+ /* begin */
136
+ 1: #include "ruby.h"
137
+ 2:
138
+ 3: typedef long rbcv_typedef_;
139
+ 4: rbcv_typedef_ *rbcv_ptr_;
140
+ 5:
141
+ 6: #include <stdio.h>
142
+ 7: /*top*/
143
+ 8: typedef unsigned
144
+ 9: #ifdef PRI_LL_PREFIX
145
+ 10: #define PRI_CONFTEST_PREFIX PRI_LL_PREFIX
146
+ 11: LONG_LONG
147
+ 12: #else
148
+ 13: #define PRI_CONFTEST_PREFIX "l"
149
+ 14: long
150
+ 15: #endif
151
+ 16: conftest_type;
152
+ 17: conftest_type conftest_const = (conftest_type)(sizeof((*rbcv_ptr_)));
153
+ 18: int main() {printf("%"PRI_CONFTEST_PREFIX"u\n", conftest_const); return 0;}
154
+ /* end */
155
+
156
+ ./conftest |
157
+ --------------------
158
+
159
+ check_sizeof: checking size of long long... -------------------- 8
160
+
161
+ "gcc -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 -c conftest.c"
162
+ conftest.c:7:5: error: size of array ‘conftest_const’ is negative
163
+ 7 | int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
164
+ | ^~~~~~~~~~~~~~
165
+ cc1: error: unrecognized command line option ‘-Wno-unknown-attributes’ [-Werror]
166
+ cc1: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
167
+ cc1: error: unrecognized command line option ‘-Wno-self-assign’ [-Werror]
168
+ cc1: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
169
+ cc1: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
170
+ cc1: all warnings being treated as errors
171
+ checked program was:
172
+ /* begin */
173
+ 1: #include "ruby.h"
174
+ 2:
175
+ 3: typedef long long rbcv_typedef_;
176
+ 4: rbcv_typedef_ *rbcv_ptr_;
177
+ 5:
178
+ 6: /*top*/
179
+ 7: int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
180
+ /* end */
181
+
182
+ "gcc -o conftest -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 conftest.c -L. -L/home/alex/.rbenv/versions/2.7.2/lib -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L. -L/home/alex/.rbenv/versions/2.7.2/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/alex/.rbenv/versions/2.7.2/lib -L/home/alex/.rbenv/versions/2.7.2/lib -lruby -lm -lc"
183
+ checked program was:
184
+ /* begin */
185
+ 1: #include "ruby.h"
186
+ 2:
187
+ 3: typedef long long rbcv_typedef_;
188
+ 4: rbcv_typedef_ *rbcv_ptr_;
189
+ 5:
190
+ 6: #include <stdio.h>
191
+ 7: /*top*/
192
+ 8: typedef unsigned
193
+ 9: #ifdef PRI_LL_PREFIX
194
+ 10: #define PRI_CONFTEST_PREFIX PRI_LL_PREFIX
195
+ 11: LONG_LONG
196
+ 12: #else
197
+ 13: #define PRI_CONFTEST_PREFIX "l"
198
+ 14: long
199
+ 15: #endif
200
+ 16: conftest_type;
201
+ 17: conftest_type conftest_const = (conftest_type)(sizeof((*rbcv_ptr_)));
202
+ 18: int main() {printf("%"PRI_CONFTEST_PREFIX"u\n", conftest_const); return 0;}
203
+ /* end */
204
+
205
+ ./conftest |
206
+ --------------------
207
+
208
+ have_type: checking for ulong... -------------------- yes
209
+
210
+ "gcc -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 -c conftest.c"
211
+ checked program was:
212
+ /* begin */
213
+ 1: #include "ruby.h"
214
+ 2:
215
+ 3: /*top*/
216
+ 4: typedef ulong conftest_type;
217
+ 5: int conftestval[sizeof(conftest_type)?1:-1];
218
+ /* end */
219
+
220
+ --------------------
221
+
222
+ have_type: checking for uchar... -------------------- no
223
+
224
+ "gcc -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 -c conftest.c"
225
+ conftest.c:4:9: error: unknown type name ‘uchar’
226
+ 4 | typedef uchar conftest_type;
227
+ | ^~~~~
228
+ cc1: error: unrecognized command line option ‘-Wno-unknown-attributes’ [-Werror]
229
+ cc1: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
230
+ cc1: error: unrecognized command line option ‘-Wno-self-assign’ [-Werror]
231
+ cc1: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
232
+ cc1: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
233
+ cc1: all warnings being treated as errors
234
+ checked program was:
235
+ /* begin */
236
+ 1: #include "ruby.h"
237
+ 2:
238
+ 3: /*top*/
239
+ 4: typedef uchar conftest_type;
240
+ 5: int conftestval[sizeof(conftest_type)?1:-1];
241
+ /* end */
242
+
243
+ --------------------
244
+
245
+ checking for whether >> on a signed long is arithmetic shift or logical shift... -------------------- arithmetic
246
+
247
+ "gcc -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 -c conftest.c"
248
+ checked program was:
249
+ /* begin */
250
+ 1: #include "ruby.h"
251
+ 2:
252
+ 3: /*top*/
253
+ 4: int conftest_const[((-1L >> (sizeof(long)/8)) == -1L) ? 1 : -1];
254
+ /* end */
255
+
256
+ --------------------
257
+
258
+ checking for presence of __builtin_bswap16... -------------------- oh yeah
259
+
260
+ "gcc -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-linux -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/backward -I/home/alex/.rbenv/versions/2.7.2/include/ruby-2.7.0 -I. -I/home/alex/.rbenv/versions/2.7.2/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC -Wall -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-ignored-attributes -Werror -O3 -march=native -mtune=native -std=c99 -I./ruby23 -c conftest.c"
261
+ checked program was:
262
+ /* begin */
263
+ 1: #include "ruby.h"
264
+ 2:
265
+ 3: /*top*/
266
+ 4: int conftest_const[(__builtin_bswap16(0xAABB) == 0xBBAA) ? 1 : -1];
267
+ /* end */
268
+
269
+ --------------------
270
+
@@ -0,0 +1,83 @@
1
+ #if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
2
+ # define BDIGIT unsigned int
3
+ # define SIZEOF_BDIGIT SIZEOF_INT
4
+ #elif SIZEOF_INT*2 <= SIZEOF_LONG
5
+ # define BDIGIT unsigned int
6
+ # define SIZEOF_BDIGIT SIZEOF_INT
7
+ #elif SIZEOF_SHORT*2 <= SIZEOF_LONG
8
+ # define BDIGIT unsigned short
9
+ # define SIZEOF_BDIGIT SIZEOF_SHORT
10
+ #else
11
+ # define BDIGIT unsigned short
12
+ # define SIZEOF_BDIGIT (SIZEOF_LONG/2)
13
+ # define SIZEOF_ACTUAL_BDIGIT SIZEOF_LONG
14
+ #endif
15
+ #ifndef SIZEOF_ACTUAL_BDIGIT
16
+ # define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGIT
17
+ #endif
18
+
19
+ #define RBIGNUM(obj) ((struct RBignum *)(obj))
20
+ #define BIGNUM_SIGN_BIT FL_USER1
21
+ #define BIGNUM_EMBED_FLAG ((VALUE)FL_USER2)
22
+ #define BIGNUM_EMBED_LEN_NUMBITS 3
23
+ #define BIGNUM_EMBED_LEN_MASK \
24
+ (~(~(VALUE)0U << BIGNUM_EMBED_LEN_NUMBITS) << BIGNUM_EMBED_LEN_SHIFT)
25
+ #define BIGNUM_EMBED_LEN_SHIFT \
26
+ (FL_USHIFT+3) /* bit offset of BIGNUM_EMBED_LEN_MASK */
27
+ #ifndef BIGNUM_EMBED_LEN_MAX
28
+ # if (SIZEOF_VALUE*RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT) < (1 << BIGNUM_EMBED_LEN_NUMBITS)-1
29
+ # define BIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT)
30
+ # else
31
+ # define BIGNUM_EMBED_LEN_MAX ((1 << BIGNUM_EMBED_LEN_NUMBITS)-1)
32
+ # endif
33
+ #endif
34
+
35
+ struct RBignum {
36
+ struct RBasic basic;
37
+ union {
38
+ struct {
39
+ size_t len;
40
+ BDIGIT *digits;
41
+ } heap;
42
+ BDIGIT ary[BIGNUM_EMBED_LEN_MAX];
43
+ } as;
44
+ };
45
+
46
+ static inline size_t BIGNUM_LEN(VALUE b);
47
+ static inline BDIGIT *BIGNUM_DIGITS(VALUE b);
48
+ static inline bool BIGNUM_EMBED_P(VALUE b);
49
+
50
+ static inline size_t
51
+ BIGNUM_LEN(VALUE b)
52
+ {
53
+ if (! BIGNUM_EMBED_P(b)) {
54
+ return RBIGNUM(b)->as.heap.len;
55
+ }
56
+ else {
57
+ size_t ret = RBASIC(b)->flags;
58
+ ret &= BIGNUM_EMBED_LEN_MASK;
59
+ ret >>= BIGNUM_EMBED_LEN_SHIFT;
60
+ return ret;
61
+ }
62
+ }
63
+
64
+ /* LSB:BIGNUM_DIGITS(b)[0], MSB:BIGNUM_DIGITS(b)[BIGNUM_LEN(b)-1] */
65
+ static inline BDIGIT *
66
+ BIGNUM_DIGITS(VALUE b)
67
+ {
68
+ if (BIGNUM_EMBED_P(b)) {
69
+ return RBIGNUM(b)->as.ary;
70
+ }
71
+ else {
72
+ return RBIGNUM(b)->as.heap.digits;
73
+ }
74
+ }
75
+
76
+ static inline bool
77
+ BIGNUM_EMBED_P(VALUE b)
78
+ {
79
+ return FL_TEST_RAW(b, BIGNUM_EMBED_FLAG);
80
+ }
81
+
82
+ #define RBIGNUM_DIGITS BIGNUM_DIGITS
83
+ #define RBIGNUM_LEN BIGNUM_LEN
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bit-twiddle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dowad
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-07 00:00:00.000000000 Z
11
+ date: 2021-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -90,10 +90,15 @@ extra_rdoc_files: []
90
90
  files:
91
91
  - LICENSE
92
92
  - README.md
93
+ - ext/bit_twiddle/Makefile
93
94
  - ext/bit_twiddle/bit_twiddle.c
95
+ - ext/bit_twiddle/bit_twiddle.o
96
+ - ext/bit_twiddle/bit_twiddle.so
94
97
  - ext/bit_twiddle/extconf.rb
98
+ - ext/bit_twiddle/mkmf.log
95
99
  - ext/bit_twiddle/ruby22/bt_bignum.h
96
100
  - ext/bit_twiddle/ruby23/bt_bignum.h
101
+ - ext/bit_twiddle/ruby30/bt_bignum.h
97
102
  - lib/bit-twiddle.rb
98
103
  - lib/bit-twiddle/core_ext.rb
99
104
  - lib/bit_twiddle.so
@@ -101,7 +106,7 @@ homepage: http://github.com/alexdowad/bit-twiddle
101
106
  licenses:
102
107
  - None (Public Domain)
103
108
  metadata: {}
104
- post_install_message:
109
+ post_install_message:
105
110
  rdoc_options: []
106
111
  require_paths:
107
112
  - lib
@@ -116,9 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
121
  - !ruby/object:Gem::Version
117
122
  version: '0'
118
123
  requirements: []
119
- rubyforge_project:
120
- rubygems_version: 2.6.13
121
- signing_key:
124
+ rubygems_version: 3.2.15
125
+ signing_key:
122
126
  specification_version: 4
123
127
  summary: Fast bitwise operations for Ruby
124
128
  test_files: []