Changeset 444 for EcnlProtoTool


Ignore:
Timestamp:
Jul 14, 2020, 11:32:49 PM (4 years ago)
Author:
coas-nagasima
Message:

muslのソースコードを追加

Location:
EcnlProtoTool/trunk
Files:
1410 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/musl-1.1.18/.project

    r331 r444  
    66        </projects>
    77        <buildSpec>
     8                <buildCommand>
     9                        <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
     10                        <triggers>clean,full,incremental,</triggers>
     11                        <arguments>
     12                        </arguments>
     13                </buildCommand>
     14                <buildCommand>
     15                        <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
     16                        <triggers>full,incremental,</triggers>
     17                        <arguments>
     18                        </arguments>
     19                </buildCommand>
    820        </buildSpec>
    921        <natures>
     22                <nature>org.eclipse.cdt.core.cnature</nature>
     23                <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
     24                <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
    1025        </natures>
    1126</projectDescription>
  • EcnlProtoTool/trunk/musl-1.1.18/include/byteswap.h

    r321 r444  
    77static __inline uint16_t __bswap_16(uint16_t __x)
    88{
    9         return __x<<8 | __x>>8;
     9        return (__x<<8) | (__x>>8);
    1010}
    1111
    1212static __inline uint32_t __bswap_32(uint32_t __x)
    1313{
    14         return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24;
     14        return (__x>>24) | ((__x>>8)&0xff00) | ((__x<<8)&0xff0000) | (__x<<24);
    1515}
    1616
    1717static __inline uint64_t __bswap_64(uint64_t __x)
    1818{
    19         return __bswap_32(__x)+0ULL<<32 | __bswap_32(__x>>32);
     19        return ((__bswap_32(__x)+0ULL)<<32) | __bswap_32(__x>>32);
    2020}
    2121
  • EcnlProtoTool/trunk/musl-1.1.18/include/endian.h

    r331 r444  
    2525static __inline uint16_t __bswap16(uint16_t __x)
    2626{
    27         return __x<<8 | __x>>8;
     27        return (__x<<8) | (__x>>8);
    2828}
    2929
    3030static __inline uint32_t __bswap32(uint32_t __x)
    3131{
    32         return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24;
     32        return (__x>>24) | ((__x>>8)&0xff00) | ((__x<<8)&0xff0000) | (__x<<24);
    3333}
    3434
    3535static __inline uint64_t __bswap64(uint64_t __x)
    3636{
    37         return __bswap32(__x)+0ULL<<32 | __bswap32(__x>>32);
     37        return ((__bswap32(__x)+0ULL)<<32) | __bswap32(__x>>32);
    3838}
    3939
  • EcnlProtoTool/trunk/musl-1.1.18/include/stddef.h

    r331 r444  
    1111#define __NEED_size_t
    1212#define __NEED_wchar_t
    13 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
     13#if __STDC_VERSION__ >= 201112L || (defined(__cplusplus) && __cplusplus >= 201103L)
    1414#define __NEED_max_align_t
    1515#endif
  • EcnlProtoTool/trunk/musl-1.1.18/include/time.h

    r331 r444  
    6161int timespec_get(struct timespec *, int);
    6262
     63#ifndef CLOCKS_PER_SEC
    6364#define CLOCKS_PER_SEC 1000000L
     65#endif // CLOCKS_PER_SEC
    6466
    6567#define TIME_UTC 1
  • EcnlProtoTool/trunk/musl-1.1.18/src/network/lookup_name.c

    r331 r444  
    1111#include <pthread.h>
    1212#include <errno.h>
     13#include <resolv.h>
    1314#include "lookup.h"
    1415#include "stdio_impl.h"
     
    3031                if (family != AF_INET6)
    3132                        buf[cnt++] = (struct address){ .family = AF_INET };
    32                 /*if (family != AF_INET)
    33                         buf[cnt++] = (struct address){ .family = AF_INET6 };*/
     33                if (family != AF_INET)
     34                        buf[cnt++] = (struct address){ .family = AF_INET6 };
    3435        } else {
    3536                if (family != AF_INET6)
    3637                        buf[cnt++] = (struct address){ .family = AF_INET, .addr = { 127,0,0,1 } };
    37                 /*if (family != AF_INET)
    38                         buf[cnt++] = (struct address){ .family = AF_INET6, .addr = { [15] = 1 } };*/
     38                if (family != AF_INET)
     39                        buf[cnt++] = (struct address){ .family = AF_INET6, .addr = { [15] = 1 } };
    3940        }
    4041        return cnt;
     
    185186        if (dots >= conf.ndots || name[l-1]=='.') *search = 0;
    186187
     188        /* Strip final dot for canon, fail if multiple trailing dots. */
     189        if (name[l-1]=='.') l--;
     190        if (!l || name[l-1]=='.') return EAI_NONAME;
     191
    187192        /* This can never happen; the caller already checked length. */
    188193        if (l >= 256) return EAI_NONAME;
     
    311316        if (!cnt && !(flags & AI_NUMERICHOST)) {
    312317                cnt = name_from_hosts(buf, canon, name, family);
    313                 if (!cnt) cnt = name_from_dns_search(buf, canon, name, family);
     318                if (cnt<=0) cnt = name_from_dns_search(buf, canon, name, family);
    314319        }
    315320        if (cnt<=0) return cnt ? cnt : EAI_NONAME;
     
    352357         * So far the label/precedence table cannot be customized. */
    353358        for (i=0; i<cnt; i++) {
     359                int family = buf[i].family;
    354360                int key = 0;
    355                 struct sockaddr_in6 sa, da = {
     361                struct sockaddr_in6 sa6 = { 0 }, da6 = {
    356362                        .sin6_family = AF_INET6,
    357363                        .sin6_scope_id = buf[i].scopeid,
    358364                        .sin6_port = 65535
    359365                };
    360                 if (buf[i].family == AF_INET6) {
    361                         memcpy(da.sin6_addr.s6_addr, buf[i].addr, 16);
     366                struct sockaddr_in sa4 = { 0 }, da4 = {
     367                        .sin_family = AF_INET,
     368                        .sin_port = 65535
     369                };
     370                void *sa, *da;
     371                socklen_t salen, dalen;
     372                if (family == AF_INET6) {
     373                        memcpy(da6.sin6_addr.s6_addr, buf[i].addr, 16);
     374                        da = &da6; dalen = sizeof da6;
     375                        sa = &sa6; salen = sizeof sa6;
    362376                } else {
    363                         memcpy(da.sin6_addr.s6_addr,
     377                        memcpy(sa6.sin6_addr.s6_addr,
    364378                                "\0\0\0\0\0\0\0\0\0\0\xff\xff", 12);
    365                         memcpy(da.sin6_addr.s6_addr+12, buf[i].addr, 4);
    366                 }
    367                 const struct policy *dpolicy = policyof(&da.sin6_addr);
    368                 int dscope = scopeof(&da.sin6_addr);
     379                        memcpy(da6.sin6_addr.s6_addr+12, buf[i].addr, 4);
     380                        memcpy(da6.sin6_addr.s6_addr,
     381                                "\0\0\0\0\0\0\0\0\0\0\xff\xff", 12);
     382                        memcpy(da6.sin6_addr.s6_addr+12, buf[i].addr, 4);
     383                        memcpy(&da4.sin_addr, buf[i].addr, 4);
     384                        da = &da4; dalen = sizeof da4;
     385                        sa = &sa4; salen = sizeof sa4;
     386                }
     387                const struct policy *dpolicy = policyof(&da6.sin6_addr);
     388                int dscope = scopeof(&da6.sin6_addr);
    369389                int dlabel = dpolicy->label;
    370390                int dprec = dpolicy->prec;
    371391                int prefixlen = 0;
    372                 int fd = socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP);
     392                int fd = socket(family, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP);
    373393                if (fd >= 0) {
    374                         if (!connect(fd, (void *)&da, sizeof da)) {
     394                        if (!connect(fd, da, dalen)) {
    375395                                key |= DAS_USABLE;
    376                                 if (!getsockname(fd, (void *)&sa,
    377                                     &(socklen_t){sizeof sa})) {
    378                                         if (dscope == scopeof(&sa.sin6_addr))
     396                                if (!getsockname(fd, sa, &salen)) {
     397                                        if (family == AF_INET) memcpy(
     398                                                sa6.sin6_addr.s6_addr+12,
     399                                                &sa4.sin_addr, 4);
     400                                        if (dscope == scopeof(&sa6.sin6_addr))
    379401                                                key |= DAS_MATCHINGSCOPE;
    380                                         if (dlabel == labelof(&sa.sin6_addr))
     402                                        if (dlabel == labelof(&sa6.sin6_addr))
    381403                                                key |= DAS_MATCHINGLABEL;
    382                                         prefixlen = prefixmatch(&sa.sin6_addr,
    383                                                 &da.sin6_addr);
     404                                        prefixlen = prefixmatch(&sa6.sin6_addr,
     405                                                &da6.sin6_addr);
    384406                                }
    385407                        }
  • EcnlProtoTool/trunk/prototool/.cproject

    r440 r444  
    143143                                                                <option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.1434992496" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
    144144                                                                <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.gcc.rz.archives.userIncludePath.299863743" name="User defined archive search directories (-L)" superClass="com.renesas.cdt.managedbuild.gcc.rz.archives.userIncludePath" useByScannerDiscovery="false" valueType="stringList">
    145                                                                         <listOptionValue builtIn="false" value="&quot;${workspace_loc:/musl-1.1.18/lib}&quot;"/>
     145                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/musl-1.1.18/Debug}&quot;"/>
    146146                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
    147147                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/openssl-1.1.0e/Debug}&quot;"/>
     
    157157                                                                <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.otherobjs.2115660767" name="Other objects" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.otherobjs" useByScannerDiscovery="false" valueType="userObjs">
    158158                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/musl-1.1.18/lib/crt1.o}&quot;"/>
    159                                                                         <listOptionValue builtIn="false" value="&quot;${workspace_loc:/musl-1.1.18/lib/libc.a}&quot;"/>
     159                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/musl-1.1.18/Debug/libmusl.a}&quot;"/>
    160160                                                                        <listOptionValue builtIn="false" value="&quot;${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/thumb/v7-ar/fpv3/hard/libgcc.a&quot;"/>
    161161                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/ntshell/Debug/ntshell_bin.o}&quot;"/>
    162                                                                         <listOptionValue builtIn="false" value="&quot;${workspace_loc:/musl-1.1.18/lib}/libce.a&quot;"/>
    163162                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/openssl-1.1.0e/Debug}/libopenssl.a&quot;"/>
    164163                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/zlib-1.2.11/Debug}/libzlib.a&quot;"/>
     
    171170                                                                </option>
    172171                                                                <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.gcc.rz.archives.userIncludeFiles.1706968451" name="User defined archive (library) files (-l)" superClass="com.renesas.cdt.managedbuild.gcc.rz.archives.userIncludeFiles" useByScannerDiscovery="false" valueType="stringList">
    173                                                                         <listOptionValue builtIn="false" value="ce"/>
     172                                                                        <listOptionValue builtIn="false" value="musl"/>
    174173                                                                        <listOptionValue builtIn="false" value="gcc"/>
    175174                                                                        <listOptionValue builtIn="false" value="openssl"/>
  • EcnlProtoTool/trunk/prototool/.project

    r439 r444  
    77                <project>mbed_api</project>
    88                <project>mruby-2.1.1</project>
     9                <project>musl-1.1.18</project>
    910                <project>ntshell</project>
    1011                <project>onigmo-6.1.3</project>
Note: See TracChangeset for help on using the changeset viewer.