vcpe/srcs/libs/include/zvector/zvector_config.h

86 lines
2.3 KiB
C
Raw Normal View History

/*
* Name: Vector_config
* Purpose: Base configuration for the ZVector library
* Author: Paolo Fabio Zaino
* Domain: General
* License: Copyright by Paolo Fabio Zaino, all rights reserved
* Distributed under MIT license
*
*/
#ifndef SRC_ZVECTOR_CONFIG_H_
#define SRC_ZVECTOR_CONFIG_H_
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
// Include some standard C lib header
#include <stdint.h>
#include <stdbool.h>
// Data alignment configuration
2022-12-02 06:42:15 +00:00
#if (ZVECT_COMPTYPE == 1)
#define ZVECT_DATAALIGN __attribute__((aligned))
#define ZVECT_PACKING __attribute__((__packed__))
#define ZVECT_ALWAYSINLINE __attribute__((__always_inline__))
#else
#define ZVECT_DATAALIGN
#define ZVECT_PACKING
#define ZVECT_ALWAYSINLINE
#endif
// Default c_vector Index type
// This is set to unsigned int of 32bit
// size (so all different architectures
// and OS behaves in a similar way)
// If you want a larger index you can
// change it to, for example, uint64_t
typedef uint32_t zvect_index;
2022-12-02 06:57:36 +00:00
// If you change zvect_index type make sure you update this value
// it's the maximum number that can be stored in a zvect_index.
#define zvect_index_max (4294967295)
// Default c_vector return type for
// error codes.
// Generally negative numbers identify
// an error.
// 0 identify completed successful
// Positive numbers identify return
// attributes, like 1 is generally true
typedef int32_t zvect_retval;
// Default c_vector storage size
// This will be used when the user
// specifies 0 (zero) as data type
// size.
#define ZVECT_DEFAULT_DATA_SIZE sizeof(int)
// Default c_vector capacity
// This will be used when the user
// does NOT specify an Initial Capacity
// or set it to 0 (zero):
#define ZVECT_INITIAL_CAPACITY 8
// The following options are handled by Make
// So you should not need to modify them here.
// Choose which type of memory functions you want
// to use for your case:
// 0 = Use Standard memcpy and memmove
// 1 = Use Optimized memcpy and memmove
#define ZVECT_MEMX_METHOD 0
// Enable/Disable thread safe code:
#define ZVECT_THREAD_SAFE 1
// Enable/Disbale reentrant code:
#define ZVECT_FULL_REENTRANT 0
// Enable/Disable DMF Extensions:
#define ZVECT_DMF_EXTENSIONS 1
// Enable/Disable SFMD Extensions:
#define ZVECT_SFMD_EXTENSIONS 1
2022-12-02 06:42:15 +00:00
#endif // SRC_ZVECTOR_CONFIG_H_