Merge pull request #2084 from amatus/push-upstream

Remove _-prefix from in6addr_*
This commit is contained in:
Alon Zakai 2014-02-09 20:19:01 -08:00
Родитель 35b3ab1920 f296cefb2f
Коммит dae556e5aa
4 изменённых файлов: 22 добавлений и 12 удалений

Просмотреть файл

@ -7354,20 +7354,10 @@ LibraryManager.library = {
// netinet/in.h
// ==========================================================================
_in6addr_any:
in6addr_any:
'allocate([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "i8", ALLOC_STATIC)',
_in6addr_loopback:
in6addr_loopback:
'allocate([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "i8", ALLOC_STATIC)',
_in6addr_linklocal_allnodes:
'allocate([255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "i8", ALLOC_STATIC)',
_in6addr_linklocal_allrouters:
'allocate([255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2], "i8", ALLOC_STATIC)',
_in6addr_interfacelocal_allnodes:
'allocate([255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "i8", ALLOC_STATIC)',
_in6addr_interfacelocal_allrouters:
'allocate([255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2], "i8", ALLOC_STATIC)',
_in6addr_sitelocal_allrouters:
'allocate([255,5,0,0,0,0,0,0,0,0,0,0,0,0,0,2], "i8", ALLOC_STATIC)',
// ==========================================================================
// netdb.h

14
tests/netinet/in.cpp Normal file
Просмотреть файл

@ -0,0 +1,14 @@
#include <netinet/in.h>
extern "C" int puts(const char *);
int main() {
struct in6_addr in6any = IN6ADDR_ANY_INIT;
struct in6_addr in6loopback = IN6ADDR_LOOPBACK_INIT;
int i;
for (i = 0; i < 16; ++i)
if (in6any.s6_addr[i] != in6addr_any.s6_addr[i])
return puts("in6addr_any != IN6ADDR_ANY_INIT\n");
for (i = 0; i < 16; ++i)
if (in6loopback.s6_addr[i] != in6addr_loopback.s6_addr[i])
return puts("in6addr_loopback != IN6ADDR_LOOPBACK_INIT\n");
return puts("pass");
}

1
tests/netinet/in.out Normal file
Просмотреть файл

@ -0,0 +1 @@
pass

Просмотреть файл

@ -4376,6 +4376,11 @@ PORT: 3979
self.do_run_from_file(src, output)
def test_netinet_in(self):
src = open(path_from_root('tests', 'netinet', 'in.cpp'), 'r').read()
expected = open(path_from_root('tests', 'netinet', 'in.out'), 'r').read()
self.do_run(src, expected)
# libc++ tests
def test_iostream(self):