Bouncer / bouncer / bouncer_headers.h
bouncer_headers.h
Raw
#ifndef BOUNCER_HEADERS_H
#define BOUNCER_HEADERS_H

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#include  <stdbool.h>

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#include  <stdbool.h>
#include <math.h>
#include <time.h>
//#pragma pack(1)

#define byte uint8_t

static byte float_to_byte(float);
static float byte_to_float(byte);

static float byte_to_float(byte a){
    float ret; 
    ret = a / 100.00 ; 
    return ret; 
}
static byte float_to_byte(float a){
    byte ret; 
    ret = a * 100; 
    return ret; 
}




#ifndef MIN
    #define MIN(a,b) ({ \
    typeof(a) _a_temp_; \
    typeof(b) _b_temp_; \
    _a_temp_ = (a); \
    _b_temp_ = (b); \
    _a_temp_ = _a_temp_ <= _b_temp_ ? _a_temp_ :_b_temp_ ; \
    })
#endif


#ifndef MAX
    #define MAX(a,b) ({ \
    typeof(a) _a_temp_; \
    typeof(b) _b_temp_; \
    _a_temp_ = (a); \
    _b_temp_ = (b); \
    _a_temp_ = _a_temp_ <= _b_temp_ ? _b_temp_: _a_temp_ ; \
    })
#endif


static PyObject *HyperParameterError;
static PyObject *VersionError;
static PyObject *MemoryError;
static PyObject *TokenError;



#endif // BOUNCER_HEADERS_H