diff options
author | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-21 08:44:59 (GMT) |
---|---|---|
committer | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-21 08:44:59 (GMT) |
commit | 9546ba62d01a9618aab91eafe77929120653d275 (patch) | |
tree | 7f6d9fb37fe6db0212ce4390e21c59ad608e5393 /programs | |
parent | 452cc970d6b35601a2501dab47050592c97bc4ed (diff) | |
download | lz4-9546ba62d01a9618aab91eafe77929120653d275.zip lz4-9546ba62d01a9618aab91eafe77929120653d275.tar.gz lz4-9546ba62d01a9618aab91eafe77929120653d275.tar.bz2 |
executables use basic types from util.h
Diffstat (limited to 'programs')
-rw-r--r-- | programs/datagen.c | 20 | ||||
-rw-r--r-- | programs/platform.h | 26 | ||||
-rw-r--r-- | programs/util.h | 11 |
3 files changed, 24 insertions, 33 deletions
diff --git a/programs/datagen.c b/programs/datagen.c index f44e310..a61afc0 100644 --- a/programs/datagen.c +++ b/programs/datagen.c @@ -27,31 +27,13 @@ * Includes **************************************/ #include "platform.h" /* Compiler options, SET_BINARY_MODE */ +#include "util.h" /* U32 */ #include <stdlib.h> /* malloc */ #include <stdio.h> /* FILE, fwrite */ #include <string.h> /* memcpy */ /************************************** -* Basic Types -**************************************/ -#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ -# include <stdint.h> - typedef uint8_t BYTE; - typedef uint16_t U16; - typedef uint32_t U32; - typedef int32_t S32; - typedef uint64_t U64; -#else - typedef unsigned char BYTE; - typedef unsigned short U16; - typedef unsigned int U32; - typedef signed int S32; - typedef unsigned long long U64; -#endif - - -/************************************** * Constants **************************************/ #define KB *(1 <<10) diff --git a/programs/platform.h b/programs/platform.h index b8911f2..c4b97c8 100644 --- a/programs/platform.h +++ b/programs/platform.h @@ -1,11 +1,21 @@ -/** - * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +/* + platform.h - compiler and OS detection + Copyright (C) 2016-present, Przemyslaw Skibinski, Yann Collet + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef PLATFORM_H_MODULE #define PLATFORM_H_MODULE diff --git a/programs/util.h b/programs/util.h index b0529b0..409f6d7 100644 --- a/programs/util.h +++ b/programs/util.h @@ -15,10 +15,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You can contact the author at : - - LZ4 source repository : https://github.com/lz4/lz4 - - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c */ #ifndef UTIL_H_MODULE @@ -88,7 +84,9 @@ extern "C" { /*-************************************************************** * Basic Types *****************************************************************/ -#if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +#ifndef BASIC_TYPES_DEFINED +#define BASIC_TYPES_DEFINED +#if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) # include <stdint.h> typedef uint8_t BYTE; typedef uint16_t U16; @@ -105,7 +103,8 @@ extern "C" { typedef signed int S32; typedef unsigned long long U64; typedef signed long long S64; -#endif +#endif +#endif /*-**************************************** |