Skip to content

Commit 6368ed0

Browse files
committed
Dispense with the separate version header
1 parent 46717ab commit 6368ed0

File tree

12 files changed

+12
-38
lines changed

12 files changed

+12
-38
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ if(NOT DEFINED SC_BUILD_SCHEMAS)
9595
"** CMake variable SC_BUILD_SCHEMAS was not set. Defaults to building ALL schemas, which will take a"
9696
" while; see http://stepcode.org/mw/index.php?title=STEPcode_CMake_variables#SC_BUILD_SCHEMAS")
9797
#this makes SC_BUILD_SCHEMAS show up in cmake-gui
98-
set(SC_BUILD_SCHEMAS "ALL" CACHE string "Semicolon-separated list of paths to EXPRESS schemas to be built")
98+
set(SC_BUILD_SCHEMAS "ALL" CACHE STRING "Semicolon-separated list of paths to EXPRESS schemas to be built")
9999
endif(NOT DEFINED SC_BUILD_SCHEMAS)
100100

101101
if(NOT SC_IS_SUBBUILD)
@@ -105,7 +105,7 @@ if(NOT SC_IS_SUBBUILD)
105105
".. Generating step can take a while if you are building several schemas.")
106106
endif(NOT SC_IS_SUBBUILD)
107107

108-
# create config headers sc_cf.h and sc_version_string.h
108+
# create config headers sc_cf.h
109109
include(${SC_CMAKE_DIR}/SC_Config_Headers.cmake)
110110

111111

cmake/SC_Config_Headers.cmake

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# create sc_cf.h and sc_version_string.h
1+
# create sc_cf.h
22

33
# Take the sc config file template as the starting point for
44
# sc_cf.h.in - scripts may need to append to the template, so
@@ -101,18 +101,6 @@ get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY SC_CONFIG_H_CONTENTS)
101101
file(WRITE ${CONFIG_H_FILE} "${CONFIG_H_FILE_CONTENTS}")
102102
configure_file(${CONFIG_H_FILE} ${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_cf.h)
103103

104-
set(VER_HDR "
105-
#ifndef SC_VERSION_STRING
106-
#define SC_VERSION_STRING
107-
static char sc_version[512] = {\"${SC_VERSION}\"};
108-
#endif"
109-
)
110-
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h "${VER_HDR}")
111-
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
112-
PROPERTIES GENERATED TRUE
113-
HEADER_FILE_ONLY TRUE
114-
)
115-
116104
# Local Variables:
117105
# tab-width: 8
118106
# mode: cmake

include/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ install(FILES ordered_attrs.h
3636
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode)
3737

3838
install(FILES ${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_cf.h
39-
${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
4039
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode)
4140

4241
# Local Variables:

include/sc_cf_cmake.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define SCL_CF_H
33

44
/**** Define statements for CMake ****/
5+
#cmakedefine SC_VERSION "@SC_VERSION@"
56
#cmakedefine HAVE_NDIR_H 1
67
#cmakedefine HAVE_STDINT_H 1
78
#cmakedefine HAVE_SYS_STAT_H 1

src/base/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ set(SC_BASE_HDRS
1515
sc_getopt.h
1616
sc_trace_fprintf.h
1717
sc_mkdir.h
18-
sc_nullptr.h
1918
path2str.h
2019
judy/src/judy.h
2120
judy/src/judyLArray.h

src/clstepcore/mgrnode.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ class DisplayNode;
2525

2626
#include <editordefines.h>
2727

28-
#include <sc_nullptr.h>
29-
3028
class InstMgr;
3129

3230
class SC_CORE_EXPORT MgrNodeBase : public GenericNode
@@ -35,7 +33,7 @@ class SC_CORE_EXPORT MgrNodeBase : public GenericNode
3533
virtual inline SDAI_Application_instance *GetSTEPentity()
3634
{
3735
abort();
38-
return nullptr;
36+
return NULL;
3937
};
4038
virtual ~MgrNodeBase() {};
4139
};

src/clstepcore/sdaiApplication_instance.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#include "sdaiApplication_instance.h"
2121
#include "superInvAttrIter.h"
2222

23-
#include <sc_nullptr.h>
24-
2523
SDAI_Application_instance NilSTEPentity;
2624

2725
bool isNilSTEPentity(const SDAI_Application_instance *ai)
@@ -995,7 +993,7 @@ const SDAI_Application_instance::iAMap_t::value_type SDAI_Application_instance::
995993
}
996994
iAstruct z;
997995
memset(&z, 0, sizeof z);
998-
iAMap_t::value_type nil((Inverse_attribute *) nullptr, z);
996+
iAMap_t::value_type nil((Inverse_attribute *) NULL, z);
999997
return nil;
1000998
}
1001999

src/exp2cxx/classes_misc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "classes.h"
55

66
#include <sc_trace_fprintf.h>
7-
#include "sc_version_string.h"
87
#include "class_strings.h"
98

109
/** \file classes_misc.c
@@ -45,7 +44,7 @@ FILE *FILEcreate(const char *filename)
4544
fprintf(file, "#ifndef %s\n", fn);
4645
fprintf(file, "#define %s\n\n", fn);
4746

48-
fprintf(file, "// This file was generated by exp2cxx,\n// %s.\n", sc_version);
47+
fprintf(file, "// This file was generated by exp2cxx,\n// %s.\n", SC_VERSION);
4948
fprintf(file, "// You probably don't want to edit it since your modifications\n");
5049
fprintf(file, "// will be lost if exp2cxx is used to regenerate it.\n\n");
5150
return (file);

src/exp2python/src/classes_python.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ N350 ( August 31, 1993 ) of ISO 10303 TC184/SC4/WG7.
2424
/* this is used to add new dictionary calls */
2525
/* #define NEWDICT */
2626

27+
#define _POSIX_C_SOURCE 200809L /* for strdup */
2728
#include <stdlib.h>
2829
#include <errno.h>
30+
#include <string.h>
2931

3032
#include "sc_memmgr.h"
3133
#include "classes.h"

src/exppp/pretty_schema.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <stdlib.h>
66
#include <errno.h>
77

8-
#include <sc_version_string.h>
98
#include <express/express.h>
109

1110
#include <exppp/exppp.h>
@@ -109,7 +108,7 @@ char *SCHEMAout(Schema s)
109108
for(hp = expheader; *hp; hp++) {
110109
if((**hp == '\0') && (**(hp + 1) == '\0')) {
111110
/* if this and the next lines are blank, put version string on this line */
112-
raw("%s\n", sc_version);
111+
raw("%s\n", SC_VERSION);
113112
} else {
114113
raw("%s\n", *hp);
115114
}

0 commit comments

Comments
 (0)