Skip to content

Reorganize public headers #8273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion builds/install/arch-specific/solaris/CS/prototype.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ s none /usr/lib/libfbclient.so.2=@prefix@/lib/libfbclient.so.2

d none @prefix@/include 0751 firebird firebird
f none @prefix@/include/ib_util.h=$SRCDIR/include/ib_util.h 0444 firebird firebird
f none @prefix@/include/perf.h=$SRCDIR/include/perf.h 0444 firebird firebird
f none @prefix@/include/iberror.h=$SRCDIR/include/iberror.h 0444 firebird firebird
f none @prefix@/include/ibase.h=$SRCDIR/include/ibase.h 0444 firebird firebird

Expand Down
1 change: 0 additions & 1 deletion builds/install/arch-specific/solaris/SS/prototype.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ s none /usr/lib/libfbclient.so.2=@prefix@/lib/libfbclient.so.2

d none @prefix@/include 0755 firebird firebird
f none @prefix@/include/ib_util.h=$SRCDIR/include/ib_util.h 0644 firebird firebird
f none @prefix@/include/perf.h=$SRCDIR/include/perf.h 0644 firebird firebird
f none @prefix@/include/iberror.h=$SRCDIR/include/iberror.h 0644 firebird firebird
f none @prefix@/include/ibase.h=$SRCDIR/include/ibase.h 0644 firebird firebird

Expand Down
1 change: 0 additions & 1 deletion builds/install/arch-specific/solx86gcc/CS/prototype.in
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ f none @prefix@/include/blr.h=$SRCDIR/include/blr.h 0644 root root
f none @prefix@/include/ib_util.h=$SRCDIR/include/ib_util.h 0644 root root
f none @prefix@/include/ibase.h=$SRCDIR/include/ibase.h 0644 root root
f none @prefix@/include/iberror.h=$SRCDIR/include/iberror.h 0644 root root
f none @prefix@/include/perf.h=$SRCDIR/include/perf.h 0644 root root

d none @prefix@/intl 0755 root root
f none @prefix@/intl/libfbintl.so=$SRCDIR/intl/libfbintl.so 0755 root root
Expand Down
2 changes: 0 additions & 2 deletions builds/install/arch-specific/win32/BuildExecutableInstall.bat
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,10 @@ for %%v in (IPLicense.txt IDPLicense.txt ) do (
:: grab some missing bits'n'pieces from different parts of the source tree
::=========================================================================
@echo Copying ib_util etc
@copy %FB_ROOT_PATH%\src\extlib\ib_util.h %FB_OUTPUT_DIR%\include > nul || (call :ERROR Copying ib_util.h failed. & goto :EOF )
@copy %FB_ROOT_PATH%\src\misc\pascal\ib_util.pas %FB_OUTPUT_DIR%\include > nul || (call :ERROR Copying ib_util.pas failed. & goto :EOF )

@echo Copying other include files required for development...
@set OUTPATH=%FB_OUTPUT_DIR%\include
@copy %FB_ROOT_PATH%\src\yvalve\perf.h %OUTPATH%\ > nul
@copy %FB_ROOT_PATH%\src\include\gen\firebird.pas %OUTPATH%\firebird\ > nul || (@call :ERROR Failure executing copy %FB_ROOT_PATH%\src\include\gen\firebird.pas %OUTPATH%\firebird\ )
@if ERRORLEVEL 1 goto :END

Expand Down
16 changes: 7 additions & 9 deletions builds/posix/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -743,20 +743,13 @@ gbak_files: $(GBAK_FILES)

INCLUDE_DEST= $(FB_BUILD)/include

NEW_INCLUDES_SRC = $(shell find $(SRC_ROOT)/include/firebird -type f)
NEW_INCLUDES_DEST = $(patsubst $(SRC_ROOT)/include/firebird/%, $(INCLUDE_DEST)/firebird/%, $(NEW_INCLUDES_SRC))

include_generic: $(INCLUDE_DEST)/ib_util.h \
$(NEW_INCLUDES_DEST)

# ib_util.h actually is a marker for a number of headers

# Copy all the other headers to the distribution directory. We use
# ib_util.h as the marker for all the files.

OtherDistribHeaders = extlib/ib_util.h \
yvalve/perf.h \
include/iberror.h \
OtherDistribHeaders = include/ib_util.h \
include/iberror.h \
include/ibase.h

SRC_OtherDistribHeaders = $(addprefix $(SRC_ROOT)/, $(OtherDistribHeaders))
Expand All @@ -765,6 +758,11 @@ $(INCLUDE_DEST)/ib_util.h : $(SRC_OtherDistribHeaders)
mkdir -p $(INCLUDE_DEST)
$(CP) $^ $(INCLUDE_DEST)/

NEW_INCLUDES_SRC = $(shell find $(SRC_ROOT)/include/firebird -type f)
NEW_INCLUDES_DEST = $(patsubst $(SRC_ROOT)/include/firebird/%, $(INCLUDE_DEST)/firebird/%, $(NEW_INCLUDES_SRC))

include_generic: $(NEW_INCLUDES_DEST) $(INCLUDE_DEST)/ib_util.h

ifeq ($(SYSTEM_BOOST_FLG),Y)
$(INCLUDE_DEST)/firebird/Message.h : $(SRC_ROOT)/include/firebird/Message.h
sed 's,^#include "\./impl/boost/\(.\+\)",#include <boost/\1>,; s/\bFB_BOOST_PP_/BOOST_PP_/g' $< > $@
Expand Down
2 changes: 0 additions & 2 deletions builds/win32/make_all.bat
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ for %%v in (gpre_boot build_msg common_test engine_test isql_test) do (
)

:: Headers
copy %FB_ROOT_PATH%\src\extlib\ib_util.h %FB_OUTPUT_DIR%\include > nul
copy %FB_ROOT_PATH%\src\jrd\perf.h %FB_OUTPUT_DIR%\include >nul
copy %FB_ROOT_PATH%\src\include\ibase.h %FB_OUTPUT_DIR%\include > nul
copy %FB_ROOT_PATH%\src\include\iberror.h %FB_OUTPUT_DIR%\include > nul
copy %FB_GEN_DIR%\iberror_c.h %FB_OUTPUT_DIR%\include\firebird\impl > nul
Expand Down
5 changes: 1 addition & 4 deletions builds/win32/msvc15/ib_util.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@
<ItemGroup>
<ClCompile Include="..\..\..\src\extlib\ib_util.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\src\extlib\ib_util.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\src\jrd</AdditionalIncludeDirectories>
Expand All @@ -209,4 +206,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
7 changes: 1 addition & 6 deletions builds/win32/msvc15/ib_util.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
<Filter>EXTLIB files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\src\extlib\ib_util.h">
<Filter>Header files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc">
<Filter>Resource files</Filter>
Expand All @@ -31,4 +26,4 @@
<ItemGroup>
<None Include="..\defs\ib_util.def" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions examples/udf/udflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
#endif
#include <string.h>
#include <math.h>
#include <ibase.h>
#include "firebird/ibase.h"
#include "example.h"
#include "ib_util.h"
#include "firebird/ib_util.h"

#define BADVAL -9999L
#define MYBUF_LEN 15 /* number of chars to get for */
Expand Down
4 changes: 1 addition & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ set_output_directory (intl intl)
# SHARED LIBRARY ib_util
########################################

add_library (ib_util SHARED extlib/ib_util.cpp extlib/ib_util.h ${VERSION_RC})
add_library (ib_util SHARED extlib/ib_util.cpp ${VERSION_RC})
set_exported_symbols (ib_util ib_util)
set_output_directory_unix (ib_util lib)

Expand Down Expand Up @@ -904,9 +904,7 @@ add_custom_target(copy_files
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/examples/stat ${output_dir}/examples/stat
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/examples/functions.c ${output_dir}/examples/functions.c
# headers
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/src/extlib/ib_util.h ${output_dir}/include/ib_util.h
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/src/include/gen/iberror.h ${output_dir}/include/iberror.h
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/src/yvalve/perf.h ${output_dir}/include/perf.h
)
add_dependencies_cc (copy_files databases)
add_dependencies_unix_cc(copy_files makeHeader)
Expand Down
8 changes: 4 additions & 4 deletions src/extlib/ib_util.h → src/include/firebird/ib_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
* Contributor(s): ______________________________________.
*/

#ifndef _IB_UTIL_H
#define _IB_UTIL_H
#ifndef FIREBIRD_IB_UTIL_H
#define FIREBIRD_IB_UTIL_H

#ifdef __cplusplus
extern "C" {
#endif

extern void *ib_util_malloc(long);
extern void* ib_util_malloc(long);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* _IB_UTIL_H */
#endif /* FIREBIRD_IB_UTIL_H */
Loading
Loading