]> git.cworth.org Git - fips/commitdiff
Add a simple fips.h file.
authorCarl Worth <cworth@cworth.org>
Wed, 24 Apr 2013 22:28:43 +0000 (15:28 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 24 Apr 2013 22:32:39 +0000 (15:32 -0700)
This pulls in a few widely-used header files, (config.h, stdio.h,
stdlib.h, and string.h), and also gives us a place to define common
macros such as unused and STRNCMP_LITERAL.

dlwrap.c
execute.c
fips.c
fips.h [new file with mode: 0644]
glxwrap.c

index 3f91a870cb61e8741639f61564e324390e656ba6..0c57f752bdf039ac2f3e15b22e62e595884f887e 100644 (file)
--- a/dlwrap.c
+++ b/dlwrap.c
 #define _GNU_SOURCE
 #include <dlfcn.h>
 
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <string.h>
+#include "fips.h"
 
 #include "dlwrap.h"
 
-#define STRNCMP_LITERAL(var, literal) \
-    strncmp ((var), (literal), sizeof (literal) - 1)
-
 void *libfips_handle;
 
 typedef void * (* fips_dlopen_t)(const char * filename, int flag);
index 527b8cbabc68dd4358ef490c812ac5595aea27ff..bf576acf318abf683432cab68c877b7d3f4bf278 100644 (file)
--- a/execute.c
+++ b/execute.c
  * THE SOFTWARE.
  */
 
-#include "config.h"
+#include "fips.h"
 
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <string.h>
 #include <errno.h>
 
 #include <unistd.h>
diff --git a/fips.c b/fips.c
index 370a2eefab16d28c25b74eb87b645cee2d3c1a9b..02f67bb80fd1e6983d4680d132f19c966f2e8065 100644 (file)
--- a/fips.c
+++ b/fips.c
@@ -19,8 +19,8 @@
  * THE SOFTWARE.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
+#include "fips.h"
+
 #include <limits.h>
 #include <getopt.h>
 
diff --git a/fips.h b/fips.h
new file mode 100644 (file)
index 0000000..4c6c5bd
--- /dev/null
+++ b/fips.h
@@ -0,0 +1,41 @@
+/* Copyright © 2013, Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef FIPS_H
+#define FIPS_H
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <string.h>
+
+#ifdef __GNUC__
+#define unused __attribute__ ((unused))
+#else
+#define unused
+#endif
+
+#define STRNCMP_LITERAL(var, literal) \
+    strncmp ((var), (literal), sizeof (literal) - 1)
+
+#endif
index 9ebe799c70aea1f5678d0c3283ecd4162aa67d98..e4252d3942405d1209a6a529956d88092dfc44f9 100644 (file)
--- a/glxwrap.c
+++ b/glxwrap.c
  * THE SOFTWARE.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <string.h>
+#include "fips.h"
 
 #include <dlfcn.h>