nsprpub/pr/tests/obsints.c

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nsprpub/pr/tests/obsints.c	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/*
    1.10 + * Test: obsints.c 
    1.11 + *
    1.12 + * Description: make sure that protypes.h defines the obsolete integer
    1.13 + * types intn, uintn, uint, int8, uint8, int16, uint16, int32, uint32,
    1.14 + * int64, and uint64.
    1.15 + */
    1.16 +
    1.17 +#include <stdio.h>
    1.18 +
    1.19 +#ifdef NO_NSPR_10_SUPPORT
    1.20 +
    1.21 +/* nothing to do */
    1.22 +int main(int argc, char **argv)
    1.23 +{
    1.24 +    printf("PASS\n");
    1.25 +    return 0;
    1.26 +}
    1.27 +
    1.28 +#else /* NO_NSPR_10_SUPPORT */
    1.29 +
    1.30 +#include "prtypes.h"  /* which includes protypes.h */
    1.31 +
    1.32 +int main(int argc, char **argv)
    1.33 +{
    1.34 +    /*
    1.35 +     * Compilation fails if any of these integer types are not
    1.36 +     * defined by protypes.h.
    1.37 +     */
    1.38 +    intn in;
    1.39 +    uintn uin;
    1.40 +    uint ui;
    1.41 +    int8 i8;
    1.42 +    uint8 ui8;
    1.43 +    int16 i16;
    1.44 +    uint16 ui16;
    1.45 +    int32 i32;
    1.46 +    uint32 ui32;
    1.47 +    int64 i64;
    1.48 +    uint64 ui64;
    1.49 +
    1.50 +    printf("PASS\n");
    1.51 +    return 0;
    1.52 +}
    1.53 +
    1.54 +#endif /* NO_NSPR_10_SUPPORT */

mercurial