diff options
author | Sverker Eriksson <[email protected]> | 2013-10-16 18:15:47 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-10-16 18:16:26 +0200 |
commit | 717cf073d2c4ccbb508a272486ec83369ed1f043 (patch) | |
tree | 86d6321d6ab6e906297b602e151630277b78997c /erts/emulator/utils/make_driver_tab | |
parent | b95da0ad6236be268d63fd960934c787971e1fd0 (diff) | |
parent | b6b0b73ecec7facefb3b9c5a7ef663599cfee4aa (diff) | |
download | otp-717cf073d2c4ccbb508a272486ec83369ed1f043.tar.gz otp-717cf073d2c4ccbb508a272486ec83369ed1f043.tar.bz2 otp-717cf073d2c4ccbb508a272486ec83369ed1f043.zip |
Merge branch 'sverk/load-nif-unicode'
OTP-11408
* sverk/load-nif-unicode:
erts: Fix bug in atom to filename conversions
Fix open_ddll for win
erts, crypto: Support NIF library with unicode filename on windows
erts: Factor out erts_convert_filename_to_wchar()
erts: Fix compiler warning
erts: Fix loading of NIF library with unicode in path
erts: Remove unused constant DRIVER_TAB_SIZE
Diffstat (limited to 'erts/emulator/utils/make_driver_tab')
-rwxr-xr-x | erts/emulator/utils/make_driver_tab | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/erts/emulator/utils/make_driver_tab b/erts/emulator/utils/make_driver_tab index 3eedef21a7..5c68143d58 100755 --- a/erts/emulator/utils/make_driver_tab +++ b/erts/emulator/utils/make_driver_tab @@ -2,7 +2,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1999-2009. All Rights Reserved. +# Copyright Ericsson AB 1999-2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -88,7 +88,7 @@ foreach (@static_drivers) { } # The array itself -print "\nErlDrvEntry *driver_tab[DRIVER_TAB_SIZE] =\n{\n"; +print "\nErlDrvEntry *driver_tab[] =\n{\n"; foreach (@emu_drivers) { print " &${_}driver_entry,\n"; @@ -126,7 +126,7 @@ foreach (@nifs) { } # The array itself -print "static ErtsStaticNifEntry static_nif_tab[DRIVER_TAB_SIZE] =\n{\n"; +print "static ErtsStaticNifEntry static_nif_tab[] =\n{\n"; foreach (@nifs) { my $d = ${_}; @@ -137,19 +137,19 @@ foreach (@nifs) { print " {NULL,NULL}\n};\n"; print <<EOF; -ErtsStaticNifInitFPtr erts_static_nif_get_nif_init(const char *name) { - int i; - for (i = 0; static_nif_tab[i].nif_name != NULL; i++) - if (strcmp(name,static_nif_tab[i].nif_name) == 0) - return static_nif_tab[i].nif_init; +ErtsStaticNifInitFPtr erts_static_nif_get_nif_init(const char *name, int len) { + ErtsStaticNifEntry* p; + for (p = static_nif_tab; p->nif_name != NULL; p++) + if (strncmp(p->nif_name, name, len) == 0 && p->nif_name[len] == 0) + return p->nif_init; return NULL; } int erts_is_static_nif(void *handle) { - int i; - for (i = 0; static_nif_tab[i].nif_name != NULL; i++) - if (((void*)static_nif_tab[i].nif_init) == handle) - return 1; + ErtsStaticNifEntry* p; + for (p = static_nif_tab; p->nif_name != NULL; p++) + if (((void*)p->nif_init) == handle) + return 1; return 0; } |