… | |
… | |
7 | #include <stdlib.h> |
7 | #include <stdlib.h> |
8 | #include <stdio.h> |
8 | #include <stdio.h> |
9 | #include <limits.h> |
9 | #include <limits.h> |
10 | #include <float.h> |
10 | #include <float.h> |
11 | |
11 | |
|
|
12 | #define ECB_NO_THREADS 1 |
12 | #include "ecb.h" |
13 | #include "ecb.h" |
13 | |
14 | |
14 | // compatibility with perl <5.18 |
15 | // compatibility with perl <5.18 |
15 | #ifndef HvNAMELEN_get |
16 | #ifndef HvNAMELEN_get |
16 | # define HvNAMELEN_get(hv) strlen (HvNAME (hv)) |
17 | # define HvNAMELEN_get(hv) strlen (HvNAME (hv)) |
… | |
… | |
323 | |
324 | |
324 | ++enc->depth; |
325 | ++enc->depth; |
325 | |
326 | |
326 | encode_uint (enc, MAJOR_ARRAY, len + 1); |
327 | encode_uint (enc, MAJOR_ARRAY, len + 1); |
327 | |
328 | |
|
|
329 | if (SvMAGICAL (av)) |
328 | for (i = 0; i <= len; ++i) |
330 | for (i = 0; i <= len; ++i) |
329 | { |
331 | { |
330 | SV **svp = av_fetch (av, i, 0); |
332 | SV **svp = av_fetch (av, i, 0); |
331 | encode_sv (enc, svp ? *svp : &PL_sv_undef); |
333 | encode_sv (enc, svp ? *svp : &PL_sv_undef); |
332 | } |
334 | } |
|
|
335 | else |
|
|
336 | for (i = 0; i <= len; ++i) |
|
|
337 | { |
|
|
338 | SV *sv = AvARRAY (av)[i]; |
|
|
339 | encode_sv (enc, sv ? sv : &PL_sv_undef); |
|
|
340 | } |
333 | |
341 | |
334 | --enc->depth; |
342 | --enc->depth; |
335 | } |
343 | } |
336 | |
344 | |
337 | static void |
345 | static void |