Revision: 75720
          http://sourceforge.net/p/brlcad/code/75720
Author:   starseeker
Date:     2020-05-07 13:33:14 +0000 (Thu, 07 May 2020)
Log Message:
-----------
move the definition of b_off_t to common.h, remove bio.h inclusions previously 
being used in headers to get that definition.

Modified Paths:
--------------
    brlcad/branches/bioh/include/bio.h
    brlcad/branches/bioh/include/bu/glob.h
    brlcad/branches/bioh/include/bu/ptbl.h
    brlcad/branches/bioh/include/bu/time.h
    brlcad/branches/bioh/include/bu/vls.h
    brlcad/branches/bioh/include/common.h
    brlcad/branches/bioh/include/rt/db_fullpath.h
    brlcad/branches/bioh/include/rt/db_instance.h
    brlcad/branches/bioh/include/rt/directory.h
    brlcad/branches/bioh/include/rt/mater.h
    brlcad/branches/bioh/include/rt/mem.h

Modified: brlcad/branches/bioh/include/bio.h
===================================================================
--- brlcad/branches/bioh/include/bio.h  2020-05-07 13:22:08 UTC (rev 75719)
+++ brlcad/branches/bioh/include/bio.h  2020-05-07 13:33:14 UTC (rev 75720)
@@ -95,35 +95,6 @@
 #   define S_ISDIR(_st_mode) (((_st_mode) & S_IFMT) == S_IFDIR)
 #endif
 
-/* We want 64 bit (large file) I/O capabilities whenever they are available.
- * Always define this before we include sys/types.h */
-#ifndef _FILE_OFFSET_BITS
-#  define _FILE_OFFSET_BITS 64
-#endif
-#include <sys/types.h>
-
-/* off_t is 32 bit size even on 64 bit Windows. In the past we have tried to
- * force off_t to be 64 bit but this is failing on newer Windows/Visual Studio
- * verions in 2020 - therefore, we instead introduce the b_off_t define to
- * properly substitute the correct numerical type for the correct platform.  */
-#if defined(_WIN64)
-#  include <sys/stat.h>
-#  define b_off_t __int64
-#  define fseek _fseeki64
-#  define ftell _ftelli64
-#  define fstat _fstati64
-#  define lseek _lseeki64
-#  define stat  _stati64
-#elif defined (_WIN32)
-#  include <sys/stat.h>
-#  define b_off_t _off_t
-#  define fstat _fstat
-#  define lseek _lseek
-#  define stat  _stat
-#else
-#  define b_off_t off_t
-#endif
-
 #endif /* BIO_H */
 
 /** @} */

Modified: brlcad/branches/bioh/include/bu/glob.h
===================================================================
--- brlcad/branches/bioh/include/bu/glob.h      2020-05-07 13:22:08 UTC (rev 
75719)
+++ brlcad/branches/bioh/include/bu/glob.h      2020-05-07 13:33:14 UTC (rev 
75720)
@@ -23,8 +23,6 @@
 
 #include "common.h"
 
-#include "bio.h" /* for b_off_t */
-
 #include "bu/defines.h"
 #include "bu/vls.h"
 

Modified: brlcad/branches/bioh/include/bu/ptbl.h
===================================================================
--- brlcad/branches/bioh/include/bu/ptbl.h      2020-05-07 13:22:08 UTC (rev 
75719)
+++ brlcad/branches/bioh/include/bu/ptbl.h      2020-05-07 13:33:14 UTC (rev 
75720)
@@ -24,7 +24,6 @@
 #include "common.h"
 
 #include <stddef.h> /* for size_t */
-#include "bio.h" /* for b_off_t */
 
 #include "bu/defines.h"
 #include "bu/magic.h"

Modified: brlcad/branches/bioh/include/bu/time.h
===================================================================
--- brlcad/branches/bioh/include/bu/time.h      2020-05-07 13:22:08 UTC (rev 
75719)
+++ brlcad/branches/bioh/include/bu/time.h      2020-05-07 13:33:14 UTC (rev 
75720)
@@ -25,7 +25,6 @@
 
 #include <stddef.h> /* for size_t */
 #include <stdlib.h> /* for getenv */
-#include "bio.h" /* for b_off_t */
 
 #include "bu/defines.h"
 #include "bu/vls.h"

Modified: brlcad/branches/bioh/include/bu/vls.h
===================================================================
--- brlcad/branches/bioh/include/bu/vls.h       2020-05-07 13:22:08 UTC (rev 
75719)
+++ brlcad/branches/bioh/include/bu/vls.h       2020-05-07 13:33:14 UTC (rev 
75720)
@@ -25,7 +25,7 @@
 #include <stddef.h> /* for size_t */
 #include <stdarg.h> /* For va_list */
 
-#include "bio.h" /* for FILE and off_t */
+#include "bio.h" /* for FILE */
 
 #include "bu/defines.h"
 #include "bu/magic.h"

Modified: brlcad/branches/bioh/include/common.h
===================================================================
--- brlcad/branches/bioh/include/common.h       2020-05-07 13:22:08 UTC (rev 
75719)
+++ brlcad/branches/bioh/include/common.h       2020-05-07 13:33:14 UTC (rev 
75720)
@@ -159,6 +159,12 @@
 #  define HAVE_U_TYPES 1
 #endif
 
+/* We want 64 bit (large file) I/O capabilities whenever they are available.
+ * Always define this before we include sys/types.h */
+#ifndef _FILE_OFFSET_BITS
+#  define _FILE_OFFSET_BITS 64
+#endif
+
 /**
  * C99 does not provide a ssize_t even though it is provided by SUS97.
  * regardless, we use it so make sure it's declared by using the
@@ -198,6 +204,28 @@
 #  endif
 #endif
 
+/* off_t is 32 bit size even on 64 bit Windows. In the past we have tried to
+ * force off_t to be 64 bit but this is failing on newer Windows/Visual Studio
+ * verions in 2020 - therefore, we instead introduce the b_off_t define to
+ * properly substitute the correct numerical type for the correct platform.  */
+#if defined(_WIN64)
+#  include <sys/stat.h>
+#  define b_off_t __int64
+#  define fseek _fseeki64
+#  define ftell _ftelli64
+#  define fstat _fstati64
+#  define lseek _lseeki64
+#  define stat  _stati64
+#elif defined (_WIN32)
+#  include <sys/stat.h>
+#  define b_off_t _off_t
+#  define fstat _fstat
+#  define lseek _lseek
+#  define stat  _stat
+#else
+#  define b_off_t off_t
+#endif
+
 /**
  * Provide a means to conveniently test the version of the GNU
  * compiler.  Use it like this:

Modified: brlcad/branches/bioh/include/rt/db_fullpath.h
===================================================================
--- brlcad/branches/bioh/include/rt/db_fullpath.h       2020-05-07 13:22:08 UTC 
(rev 75719)
+++ brlcad/branches/bioh/include/rt/db_fullpath.h       2020-05-07 13:33:14 UTC 
(rev 75720)
@@ -22,7 +22,6 @@
 #define RT_DB_FULLPATH_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_t */
 #include "bu/vls.h"
 #include "rt/defines.h"
 

Modified: brlcad/branches/bioh/include/rt/db_instance.h
===================================================================
--- brlcad/branches/bioh/include/rt/db_instance.h       2020-05-07 13:22:08 UTC 
(rev 75719)
+++ brlcad/branches/bioh/include/rt/db_instance.h       2020-05-07 13:33:14 UTC 
(rev 75720)
@@ -25,7 +25,6 @@
 #define RT_DB_INSTANCE_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_t */
 
 /* interface headers */
 #include "bu/magic.h"

Modified: brlcad/branches/bioh/include/rt/directory.h
===================================================================
--- brlcad/branches/bioh/include/rt/directory.h 2020-05-07 13:22:08 UTC (rev 
75719)
+++ brlcad/branches/bioh/include/rt/directory.h 2020-05-07 13:33:14 UTC (rev 
75720)
@@ -25,7 +25,6 @@
 #define RT_DIRECTORY_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_T */
 #include "vmath.h"
 #include "bu/list.h"
 #include "rt/anim.h"

Modified: brlcad/branches/bioh/include/rt/mater.h
===================================================================
--- brlcad/branches/bioh/include/rt/mater.h     2020-05-07 13:22:08 UTC (rev 
75719)
+++ brlcad/branches/bioh/include/rt/mater.h     2020-05-07 13:33:14 UTC (rev 
75720)
@@ -25,7 +25,6 @@
 #define RT_MATER_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_t */
 #include "rt/defines.h"
 #include "bu/vls.h"
 

Modified: brlcad/branches/bioh/include/rt/mem.h
===================================================================
--- brlcad/branches/bioh/include/rt/mem.h       2020-05-07 13:22:08 UTC (rev 
75719)
+++ brlcad/branches/bioh/include/rt/mem.h       2020-05-07 13:33:14 UTC (rev 
75720)
@@ -25,7 +25,6 @@
 #define RT_MEM_H
 
 #include "common.h"
-#include "bio.h" /* for b_off_t */
 #include "vmath.h"
 #include "rt/defines.h"
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to