1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/mkmf.rb (try_func, try_var, have_struct_member),

(scalar_ptr_type?, scalar_type?): use MAIN_DOES_NOTHING.

* lib/mkmf.rb (MAIN_DOES_NOTHING): defaults to ordinary main.

* win32/Makefile.sub (config): for MAIN_DOES_NOTHING for wince.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-08-31 08:52:56 +00:00
parent 11d35f6723
commit 70b98dd4af
3 changed files with 19 additions and 6 deletions

View file

@ -1,3 +1,12 @@
Sun Aug 31 17:52:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (try_func, try_var, have_struct_member),
(scalar_ptr_type?, scalar_type?): use MAIN_DOES_NOTHING.
* lib/mkmf.rb (MAIN_DOES_NOTHING): defaults to ordinary main.
* win32/Makefile.sub (config): for MAIN_DOES_NOTHING for wince.
Sun Aug 31 17:30:35 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* spec/README (How to run): added.

View file

@ -506,12 +506,12 @@ def try_func(func, libs, headers = nil, &b)
#{COMMON_HEADERS}
#{headers}
/*top*/
int main() { return 0; }
#{MAIN_DOES_NOTHING}
int t() { void ((*volatile p)()); p = (void ((*)()))#{func}; return 0; }
SRC
#{headers}
/*top*/
int main() { return 0; }
#{MAIN_DOES_NOTHING}
int t() { #{func}(); return 0; }
SRC
end
@ -522,7 +522,7 @@ def try_var(var, headers = nil, &b)
#{COMMON_HEADERS}
#{headers}
/*top*/
int main() { return 0; }
#{MAIN_DOES_NOTHING}
int t() { const volatile void *volatile p; p = &(&#{var})[0]; return 0; }
SRC
end
@ -840,7 +840,7 @@ def have_struct_member(type, member, headers = nil, &b)
#{COMMON_HEADERS}
#{cpp_include(headers)}
/*top*/
int main() { return 0; }
#{MAIN_DOES_NOTHING}
int s = (char *)&((#{type}*)0)->#{member} - (char *)0;
SRC
$defs.push(format("-DHAVE_%s_%s", type.tr_cpp, member.tr_cpp))
@ -978,7 +978,7 @@ def scalar_ptr_type?(type, member = nil, headers = nil, &b)
#{cpp_include(headers)}
/*top*/
volatile #{type} conftestval;
int main() { return 0; }
#{MAIN_DOES_NOTHING}
int t() {return (int)(1-*(conftestval#{member ? ".#{member}" : ""}));}
SRC
end
@ -991,7 +991,7 @@ def scalar_type?(type, member = nil, headers = nil, &b)
#{cpp_include(headers)}
/*top*/
volatile #{type} conftestval;
int main() { return 0; }
#{MAIN_DOES_NOTHING}
int t() {return (int)(1-(conftestval#{member ? ".#{member}" : ""}));}
SRC
end
@ -1875,6 +1875,7 @@ LINK_SO = config_string('LINK_SO') ||
LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L"%s"'
RPATHFLAG = config_string('RPATHFLAG') || ''
LIBARG = config_string('LIBARG') || '-l%s'
MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main() {return 0;}'
sep = config_string('BUILD_FILE_SEPARATOR') {|s| ":/=#{s}" if sep != "/"} || ""
CLEANINGS = "

View file

@ -523,6 +523,9 @@ config.status: $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.su
@exit <<$@
# Generated automatically by Makefile.sub.
s,@SHELL@,$$(COMSPEC),;t t
!if defined(WIN32_WCE)
s,@MAIN_DOES_NOTHING@,int WinMain(HINSTANCE h, HINSTANCE hp, LPWSTR s, int n) {return 0;},;t t
!endif
s,@BUILD_FILE_SEPARATOR@,\,;t t
s,@PATH_SEPARATOR@,;,;t t
s,@CFLAGS@,$(CFLAGS),;t t