# There is some symbol defined in global.sym and interp.sym
# that does not present in the WIN32 port but there is no easy
-# way to find them so I just put a exeception list here
+# way to find them so I just put a exception list here
+
+while (@ARGV && $ARGV[0] =~ /^-/)
+ {
+ my $flag = shift;
+ $define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
+ }
+
+warn join(' ',keys %define)."\n";
+
+my $CCTYPE = shift || "MSVC";
$skip_sym=<<'!END!OF!SKIP!';
-Perl_SvIV
-Perl_SvNV
-Perl_SvTRUE
-Perl_SvUV
Perl_block_type
-Perl_sv_pvn
Perl_additem
Perl_cast_ulong
Perl_check_uni
Perl_force_word
Perl_hv_stashpv
Perl_intuit_more
+Perl_init_thread_intern
Perl_know_next
Perl_modkids
Perl_mstats
Perl_pp_map
Perl_pp_nswitch
Perl_q
+Perl_rcsid
Perl_reall_srchlen
Perl_regdump
Perl_regfold
Perl_skipspace
Perl_sublex_done
Perl_sublex_start
-Perl_sv_peek
Perl_sv_ref
Perl_sv_setptrobj
Perl_timesbuf
Perl_yyrule
allgvs
curblock
-curcop
-curcopdb
curcsv
-envgv
lastretstr
mystack_mark
perl_init_ext
perl_requirepv
-siggv
stack
statusvalue_vms
-tainting
Perl_safexcalloc
Perl_safexmalloc
Perl_safexfree
Perl_my_memset
Perl_cshlen
Perl_cshname
+Perl_opsave
+!END!OF!SKIP!
+
+unless ($define{'USE_THREADS'})
+ {
+ $skip_sym .= <<'!END!OF!SKIP!';
+Perl_condpair_magic
+Perl_thr_key
+Perl_sv_mutex
+Perl_malloc_mutex
+Perl_eval_mutex
+Perl_eval_cond
+Perl_eval_owner
+Perl_threads_mutex
+Perl_new_struct_thread
+Perl_nthreads
+Perl_nthreads_cond
+Perl_per_thread_magicals
+Perl_thrsv
+Perl_unlock_condpair
+Perl_vtbl_mutex
+Perl_magic_mutexfree
+Perl_sv_iv
+Perl_sv_nv
+Perl_sv_true
+Perl_sv_uv
+Perl_sv_pvn
+Perl_newRV_noinc
!END!OF!SKIP!
+ }
+
+if ($define{'USE_THISPTR'} || $define{'USE_THREADS'})
+ {
+ open(THREAD,"<../thread.sym") || die "Cannot open thread.sym:$!";
+ while (<THREAD>)
+ {
+ next if (!/^[A-Za-z]/);
+ next if (/_amg[ \t]*$/);
+ $skip_sym .= "Perl_".$_;
+ }
+ close(THREAD);
+ $skip_sym .= "Perl_op\n";
+ }
+
+unless ($define{'USE_THREADS'})
+ {
+ $skip_sym .= "Perl_thread_create\n";
+ }
# All symbols have a Perl_ prefix because that's what embed.h
# sticks in front of them.
next if (/_amg[ \t]*$/);
$symbol = "Perl_$_";
next if ($skip_sym =~ m/$symbol/m);
- print "\t$symbol";
- };
+ emit_symbol($symbol);
+}
close(GLOBAL);
# also add symbols from interp.sym
$symbol = $_;
next if ($skip_sym =~ m/$symbol/m);
#print "\t$symbol";
- print "\tPerl_$symbol";
- };
+ emit_symbol("Perl_" . $symbol);
+}
#close(INTERP);
next if (/^#/);
$symbol = $_;
next if ($skip_sym =~ m/^$symbol/m);
- print "\t$symbol";
- };
+ $symbol = "Perl_".$symbol if ($define{'USE_THISPTR'}
+ && $symbol =~ /^perl/);
+ emit_symbol($symbol);
+}
+
+sub emit_symbol {
+ my $symbol = shift;
+ chomp $symbol;
+ if ($CCTYPE eq "BORLAND") {
+ # workaround Borland quirk by exporting both the straight
+ # name and a name with leading underscore. Note the
+ # alias *must* come after the symbol itself, if both
+ # are to be exported. (Linker bug?)
+ print "\t_$symbol\n";
+ print "\t$symbol = _$symbol\n";
+ }
+ else {
+ # for binary coexistence, export both the symbol and
+ # alias with leading underscore
+ print "\t$symbol\n";
+ print "\t_$symbol = $symbol\n";
+ }
+}
1;
__DATA__
perl_eval_pv
perl_eval_sv
boot_DynaLoader
+Perl_thread_create
win32_errno
win32_environ
win32_stdin
win32_eof
win32_read
win32_write
-win32_spawnvpe
-win32_spawnle
+win32_spawnvp
win32_mkdir
win32_rmdir
win32_chdir
win32_flock
+win32_execvp
win32_htons
win32_ntohs
win32_htonl
win32_recv
win32_recvfrom
win32_shutdown
+win32_closesocket
win32_ioctlsocket
win32_setsockopt
win32_getsockopt
win32_setnetent
win32_setprotoent
win32_setservent
+win32_getenv
+win32_perror
+win32_setbuf
+win32_setvbuf
+win32_flushall
+win32_fcloseall
+win32_fgets
+win32_gets
+win32_fgetc
+win32_putc
+win32_puts
+win32_getchar
+win32_putchar
+win32_malloc
+win32_calloc
+win32_realloc
+win32_free
+win32_sleep
+win32_times
+win32_alarm
+win32_open_osfhandle
+win32_get_osfhandle
+Perl_win32_init
+Perl_init_os_extras
+RunPerl