Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 328cc31 in mainline


Ignore:
Timestamp:
2013-03-11T13:57:01Z (9 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
36ceaac
Parents:
dd870b1
Message:

Check uint*_t sizes at compile time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/main/main.c

    rdd870b1 r328cc31  
    8989#include <lib/ra.h>
    9090
     91/* Ensure [u]int*_t types are of correct size.
     92 *
     93 * Probably, this is not the best place for such tests
     94 * but this file is compiled on all architectures.
     95 */
     96#define CHECK_INT_TYPE_(signness, size) \
     97        STATIC_ASSERT_VERBOSE(sizeof(signness##size##_t) * 8 == size, \
     98            #signness #size "_t does not have " #size " bits");
     99#define CHECK_INT_TYPE(size) \
     100        CHECK_INT_TYPE_(int, size); CHECK_INT_TYPE_(uint, size)
     101
     102CHECK_INT_TYPE(8);
     103CHECK_INT_TYPE(16);
     104CHECK_INT_TYPE(32);
     105CHECK_INT_TYPE(64);
     106
     107
     108
     109
    91110/** Global configuration structure. */
    92111config_t config = {
Note: See TracChangeset for help on using the changeset viewer.