From 34d681a00a7fc3c8d82a5ba3082dd5524f2a8389 Mon Sep 17 00:00:00 2001 From: Chernov Dmitriy <cd_work@mail.ru> Date: 周二, 01 3月 2016 21:26:22 +0800 Subject: [PATCH] The basic implementation completed. Tests are needed. (issue #73) --- libscpi/inc/scpi/config.h | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libscpi/inc/scpi/config.h b/libscpi/inc/scpi/config.h index ea19d8e..85cd07f 100644 --- a/libscpi/inc/scpi/config.h +++ b/libscpi/inc/scpi/config.h @@ -90,10 +90,10 @@ #endif #ifndef USE_DEVICE_DEPENDENT_ERROR_INFORMATION -#define USE_DEVICE_DEPENDENT_ERROR_INFORMATION 1 - #ifndef USE_MEMORY_ALLOCATION_FREE - #define USE_MEMORY_ALLOCATION_FREE 1 - #endif +#define USE_DEVICE_DEPENDENT_ERROR_INFORMATION 0 +#ifndef USE_MEMORY_ALLOCATION_FREE +#define USE_MEMORY_ALLOCATION_FREE 1 +#endif #endif @@ -259,23 +259,23 @@ #endif #if USE_DEVICE_DEPENDENT_ERROR_INFORMATION - #if USE_MEMORY_ALLOCATION_FREE - #include <stdlib.h> - #include <string.h> - #include <malloc.h> - #define SCPIDEFINE_DESCRIPTION_MAX_PARTS 2 - #define SCPIDEFINE_strdup(h, s) strdup((s)) - #define SCPIDEFINE_free(h, s, r) free((s)) - #else - #define SCPIDEFINE_DESCRIPTION_MAX_PARTS 3 - #define SCPIDEFINE_strdup(h, s) OUR_strdup((h), (s)) - #define SCPIDEFINE_free(h, s, r) OUR_free((h), (s), (r)) - #define SCPIDEFINE_get_parts(h, s, l1, s2, l2) OUR_get_parts((h), (s), (l1), (s2), (l2)) - #endif + +#if USE_MEMORY_ALLOCATION_FREE +#include <stdlib.h> +#include <string.h> +#define SCPIDEFINE_DESCRIPTION_MAX_PARTS 2 +#define SCPIDEFINE_strdup(h, s) strdup((s)) +#define SCPIDEFINE_free(h, s, r) free((s)) #else - #define SCPIDEFINE_DESCRIPTION_MAX_PARTS 1 - #define SCPIDEFINE_strdup(h, s) NULL - #define SCPIDEFINE_free(h, s, r) (void) +#define SCPIDEFINE_DESCRIPTION_MAX_PARTS 3 +#define SCPIDEFINE_strdup(h, s) OUR_strdup((h), (s)) +#define SCPIDEFINE_free(h, s, r) OUR_free((h), (s), (r)) +#define SCPIDEFINE_get_parts(h, s, l1, s2, l2) OUR_get_parts((h), (s), (l1), (s2), (l2)) +#endif +#else +#define SCPIDEFINE_DESCRIPTION_MAX_PARTS 1 +#define SCPIDEFINE_strdup(h, s) NULL +#define SCPIDEFINE_free(h, s, r) (void) #endif #ifdef __cplusplus -- Gitblit v1.9.1