Home | History | Annotate | Download | only in libcommon
      1 /*
      2  *
      3  * honggfuzz - core macros and helpers
      4  * -----------------------------------------
      5  *
      6  * Author: Robert Swiecki <swiecki (at) google.com>
      7  *
      8  * Copyright 2010-2017 by Google Inc. All Rights Reserved.
      9  *
     10  * Licensed under the Apache License, Version 2.0 (the "License"); you may
     11  * not use this file except in compliance with the License. You may obtain
     12  * a copy of the License at
     13  *
     14  * http://www.apache.org/licenses/LICENSE-2.0
     15  *
     16  * Unless required by applicable law or agreed to in writing, software
     17  * distributed under the License is distributed on an "AS IS" BASIS,
     18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
     19  * implied. See the License for the specific language governing
     20  * permissions and limitations under the License.
     21  *
     22  */
     23 
     24 #ifndef _HF_COMMON_H_
     25 #define _HF_COMMON_H_
     26 
     27 #include <dirent.h>
     28 #include <inttypes.h>
     29 #include <limits.h>
     30 #include <pthread.h>
     31 #include <stdbool.h>
     32 #include <stdint.h>
     33 #include <sys/param.h>
     34 #include <sys/queue.h>
     35 #include <sys/types.h>
     36 #include <time.h>
     37 
     38 #ifndef UNUSED
     39 #define UNUSED __attribute__((unused))
     40 #endif
     41 
     42 #define ARRAYSIZE(x) (sizeof(x) / sizeof(*x))
     43 
     44 /* Memory barriers */
     45 #define rmb() __asm__ __volatile__("" ::: "memory")
     46 #define wmb() __sync_synchronize()
     47 
     48 #endif /* ifndef _HF_COMMON_H_ */
     49