Check-in [b43586041b]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:clearer way to get sizeof sockaddr_in.sin_zero
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b43586041b061b69c9e4d20bd07cede13e890c2d
User & Date: aldo 2016-12-12 23:11:39
Context
2016-12-13
00:03
added sxml match check-in: 4d83ff5dcb user: aldo tags: trunk
2016-12-12
23:11
clearer way to get sizeof sockaddr_in.sin_zero check-in: b43586041b user: aldo tags: trunk
22:48
fixed sockaddr_in.sin_zero size, thanks to gwatt check-in: f1282eed3e user: aldo tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to socket.sls.

    58     58       (define-ftype in_addr
    59     59         (struct (s_addr in_addr_t)))
    60     60       
    61     61       ;; WARNING- here the size of sin_zero should be calculated on your machine as:
    62     62       
    63     63       #;(import (c-eval))
    64     64       #;(parameterize ([c-eval-includes '("stdio.h" "sys/socket.h" "netinet/in.h")])
    65         -    (c-eval-printf "%d" "sizeof(struct sockaddr_in) - sizeof (sa_family_t) - sizeof(in_port_t) - sizeof(in_addr_t)"))
           65  +    (c-eval-printf "%d" "sizeof(((struct sockaddr_in *) NULL)->sin_zero)"))
    66     66       ;; in my case  (a6le) -> 8
    67     67       
    68     68       (define-ftype sockaddr_in
    69     69         (struct
    70     70          (sin_family sa_family_t)
    71     71          (sin_port in_port_t)
    72     72          (sin_addr in_addr)