]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
util.h: restore BSD license for Facebook Open-Source 489/head
authorPrzemyslaw Skibinski <inikep@gmail.com>
Wed, 21 Dec 2016 14:08:44 +0000 (15:08 +0100)
committerPrzemyslaw Skibinski <inikep@gmail.com>
Wed, 21 Dec 2016 14:08:44 +0000 (15:08 +0100)
programs/bench.c
programs/dibio.c
programs/fileio.c
programs/platform.h
programs/util.h
programs/zstdcli.c

index 5d142529ff52579c6a0490658a10195147dbdef1..4089d6ba750df351b6863623e4837e23315075db 100644 (file)
@@ -20,6 +20,7 @@
 /* *************************************
 *  Includes
 ***************************************/
+#include "platform.h"    /* Large Files support */
 #include "util.h"        /* UTIL_getFileSize, UTIL_sleep */
 #include <stdlib.h>      /* malloc, free */
 #include <string.h>      /* memset */
index 743d3ef9358e5e979b37f57328bfc45e6d00491f..b95bab34ee572d927729616e18b79bc735edd039 100644 (file)
@@ -20,6 +20,7 @@
 /*-*************************************
 *  Includes
 ***************************************/
+#include "platform.h"       /* Large Files support */
 #include "util.h"           /* UTIL_getFileSize, UTIL_getTotalFileSize */
 #include <stdlib.h>         /* malloc, free */
 #include <string.h>         /* memset */
index 8305fbd763811d4287afb1744781290fa65a8531..a112cc0499b6d3ffe54e974f6a1f39c89c8f239b 100644 (file)
@@ -22,7 +22,8 @@
 /*-*************************************
 *  Includes
 ***************************************/
-#include "util.h"       /* SET_BINARY_MODE, UTIL_getFileSize */
+#include "platform.h"   /* Large Files support, SET_BINARY_MODE */
+#include "util.h"       /* UTIL_getFileSize */
 #include <stdio.h>      /* fprintf, fopen, fread, _fileno, stdin, stdout */
 #include <stdlib.h>     /* malloc, free */
 #include <string.h>     /* strcmp, strlen */
index 0b82e46bfb84fb5c112b6e0121491c7da7f148d1..f30528aa97c5702380c02028d29e16805a908559 100644 (file)
@@ -1,21 +1,13 @@
-/*
-    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.
-*/
+/**
+ * platform.h - compiler and OS detection
+ * 
+ * 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.
+ */
 
 #ifndef PLATFORM_H_MODULE
 #define PLATFORM_H_MODULE
@@ -25,6 +17,19 @@ extern "C" {
 #endif
 
 
+
+/* **************************************
+*  Compiler Options
+****************************************/
+#if defined(_MSC_VER)
+#  define _CRT_SECURE_NO_WARNINGS   /* Disable Visual Studio warning messages for fopen, strncpy, strerror */
+#  define _CRT_SECURE_NO_DEPRECATE  /* VS2005 - must be declared before <io.h> and <windows.h> */ 
+#  if (_MSC_VER <= 1800)            /* (1800 = Visual Studio 2013) */
+#    define snprintf sprintf_s      /* snprintf unsupported by Visual <= 2013 */
+#  endif
+#endif
+
+
 /* **************************************
 *  Detect 64-bit OS
 *  http://nadeausoftware.com/articles/2012/02/c_c_tip_how_detect_processor_type_using_compiler_predefined_macros
index 5779fa772d1c44531670062f600fbe0f91d2f78c..aaa4b7c1eef1c08e7c153feac106b3de57dfc1a4 100644 (file)
@@ -1,21 +1,13 @@
-/*
-    util.h - utility functions
-    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.
-*/
+/**
+ * util.h - utility functions
+ * 
+ * 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.
+ */
 
 #ifndef UTIL_H_MODULE
 #define UTIL_H_MODULE
@@ -25,17 +17,6 @@ extern "C" {
 #endif
 
 
-/* **************************************
-*  Compiler Options
-****************************************/
-#if defined(_MSC_VER)
-#  define _CRT_SECURE_NO_WARNINGS   /* Disable Visual Studio warning messages for fopen, strncpy, strerror */
-#  define _CRT_SECURE_NO_DEPRECATE  /* VS2005 */ 
-#  if (_MSC_VER <= 1800)            /* (1800 = Visual Studio 2013) */
-#    define snprintf sprintf_s      /* snprintf unsupported by Visual <= 2013 */
-#  endif
-#endif
-
 
 /*-****************************************
 *  Dependencies
index 0b6f9241cc8b63ae7ec4c8b777394aeaa5a11364..978ffcfe08cacce3a81886289030b5bd7d584145 100644 (file)
@@ -23,7 +23,8 @@
 /*-************************************
 *  Dependencies
 **************************************/
-#include "util.h"     /* IS_CONSOLE, UTIL_HAS_CREATEFILELIST, UTIL_createFileList */
+#include "platform.h" /* IS_CONSOLE, PLATFORM_POSIX_VERSION */
+#include "util.h"     /* UTIL_HAS_CREATEFILELIST, UTIL_createFileList */
 #include <string.h>   /* strcmp, strlen */
 #include <errno.h>    /* errno */
 #include "fileio.h"