Skip to content
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

Remove ICE_BUILDING_xxx macros, streamline Config.h #3398

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 4 additions & 8 deletions cpp/include/DataStorm/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@

#include "Ice/Config.h"

#if !defined(ICE_BUILDING_DATASTORM) && defined(DATASTORM_API_EXPORTS)
# define ICE_BUILDING_DATASTORM
#endif

#if defined(_MSC_VER) && !defined(ICE_BUILDING_DATASTORM)
# pragma comment(lib, ICE_LIBNAME("DataStorm")) // Automatically link with DataStorm[D].lib
#endif

#ifndef DATASTORM_API
# if defined(DATASTORM_API_EXPORTS)
# define DATASTORM_API ICE_DECLSPEC_EXPORT
Expand All @@ -21,4 +13,8 @@
# endif
#endif

#if defined(_MSC_VER) && !defined(DATASTORM_API_EXPORTS)
# pragma comment(lib, ICE_LIBNAME("DataStorm")) // Automatically link with DataStorm[D].lib
#endif

#endif
16 changes: 3 additions & 13 deletions cpp/include/Glacier2/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,12 @@
#ifndef GLACIER2_CONFIG_H
#define GLACIER2_CONFIG_H

#include "Ice/Config.h"
// This header is included in all Glacier generated headers.
bernardnormier marked this conversation as resolved.
Show resolved Hide resolved

#if !defined(ICE_BUILDING_GLACIER2) && defined(GLACIER2_API_EXPORTS)
# define ICE_BUILDING_GLACIER2
#endif
#include "Ice/Config.h"

#if defined(_MSC_VER) && !defined(ICE_BUILDING_GLACIER2)
#if defined(_MSC_VER) && !defined(GLACIER2_API_EXPORTS)
# pragma comment(lib, ICE_LIBNAME("Glacier2")) // Automatically link with Glacier2[D].lib
#endif

#ifndef GLACIER2_API
# if defined(GLACIER2_API_EXPORTS)
# define GLACIER2_API ICE_DECLSPEC_EXPORT
# else
# define GLACIER2_API ICE_DECLSPEC_IMPORT
# endif
#endif

#endif
1 change: 0 additions & 1 deletion cpp/include/Glacier2/Glacier2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#ifndef GLACIER2_H
#define GLACIER2_H

#include "Config.h"
#include "Glacier2/Metrics.h"
#include "Glacier2/PermissionsVerifier.h"
#include "Glacier2/Router.h"
Expand Down
24 changes: 11 additions & 13 deletions cpp/include/Ice/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,17 @@
# define ICE_BUILDING_ICE
#endif

#ifdef _MSC_VER
# if !defined(ICE_BUILDING_SLICE_COMPILERS) // Not using the IceUtil static build
# if !defined(_DLL) || !defined(_MT)
# error "Ice C++ applications on Windows require /MD or /MDd."
# endif
# if defined(_DEBUG)
# define ICE_LIBNAME(NAME) NAME ICE_SO_VERSION "D.lib"
# else
# define ICE_LIBNAME(NAME) NAME ICE_SO_VERSION ".lib"
# endif
# if !defined(ICE_BUILDING_ICE)
# pragma comment(lib, ICE_LIBNAME("Ice")) // Automatically link with Ice[D].lib
# endif
#if defined(_MSC_VER) && !defined(ICE_BUILDING_SLICE_COMPILERS) // Not using the IceUtil static build
# if !defined(_DLL) || !defined(_MT)
# error "Ice C++ applications on Windows require /MD or /MDd."
# endif
# if defined(_DEBUG)
# define ICE_LIBNAME(NAME) NAME ICE_SO_VERSION "D.lib"
# else
# define ICE_LIBNAME(NAME) NAME ICE_SO_VERSION ".lib"
# endif
# if !defined(ICE_BUILDING_ICE)
# pragma comment(lib, ICE_LIBNAME("Ice")) // Automatically link with Ice[D].lib
# endif
#endif

Expand Down
22 changes: 4 additions & 18 deletions cpp/include/IceBox/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,12 @@
#ifndef ICEBOX_CONFIG_H
#define ICEBOX_CONFIG_H

#include "Ice/Config.h"

#ifndef ICEBOX_API
# if defined(ICEBOX_API_EXPORTS)
# define ICEBOX_API ICE_DECLSPEC_EXPORT
# else
# define ICEBOX_API ICE_DECLSPEC_IMPORT
# endif
#endif
// This header is included in all IceBox generated headers.

//
// Automatically link with IceBox[D].lib
//

#if !defined(ICE_BUILDING_ICEBOX) && defined(ICEBOX_API_EXPORTS)
# define ICE_BUILDING_ICEBOX
#endif
#include "Ice/Config.h"

#if defined(_MSC_VER) && !defined(ICE_BUILDING_ICEBOX)
# pragma comment(lib, ICE_LIBNAME("IceBox"))
#if defined(_MSC_VER) && !defined(ICEBOX_API_EXPORTS)
# pragma comment(lib, ICE_LIBNAME("IceBox")) // Automatically link with IceBox[D].lib
#endif

#endif
1 change: 0 additions & 1 deletion cpp/include/IceBox/IceBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

// Provides the full IceBox API.

#include "Config.h"
#include "IceBox/ServiceManager.h"
#include "Service.h"

Expand Down
9 changes: 8 additions & 1 deletion cpp/include/IceBox/Service.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
#ifndef ICEBOX_SERVICE_H
#define ICEBOX_SERVICE_H

#include "Config.h"
#include "Ice/Ice.h"

#ifndef ICEBOX_API
# if defined(ICEBOX_API_EXPORTS)
# define ICEBOX_API ICE_DECLSPEC_EXPORT
# else
# define ICEBOX_API ICE_DECLSPEC_IMPORT
# endif
#endif

namespace IceBox
{
/**
Expand Down
16 changes: 3 additions & 13 deletions cpp/include/IceGrid/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,11 @@
#ifndef ICEGRID_CONFIG_H
#define ICEGRID_CONFIG_H

#include "Ice/Config.h"

#ifndef ICEGRID_API
# if defined(ICEGRID_API_EXPORTS)
# define ICEGRID_API ICE_DECLSPEC_EXPORT
# else
# define ICEGRID_API ICE_DECLSPEC_IMPORT
# endif
#endif
// This header is included in all IceGrid generated headers.

#if !defined(ICE_BUILDING_ICEGRID) && defined(ICEGRID_API_EXPORTS)
# define ICE_BUILDING_ICEGRID
#endif
#include "Ice/Config.h"

#if defined(_MSC_VER) && !defined(ICE_BUILDING_ICEGRID)
#if defined(_MSC_VER) && !defined(ICEGRID_API_EXPORTS)
# pragma comment(lib, ICE_LIBNAME("IceGrid")) // Automatically link with IceGrid[D].lib
#endif

Expand Down
1 change: 0 additions & 1 deletion cpp/include/IceGrid/IceGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#ifndef ICEGRID_H
#define ICEGRID_H

#include "Config.h"
#include "IceGrid/Admin.h"
#include "IceGrid/Descriptor.h"
#include "IceGrid/Exception.h"
Expand Down
1 change: 0 additions & 1 deletion cpp/include/IceGrid/PluginFacade.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#ifndef ICEGRID_PLUGIN_FACADE_H
#define ICEGRID_PLUGIN_FACADE_H

#include "Config.h"
#include "Ice/Ice.h"
#include "IceGrid/Admin.h"

Expand Down
14 changes: 4 additions & 10 deletions cpp/include/IceStorm/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
#ifndef ICESTORM_CONFIG_H
#define ICESTORM_CONFIG_H

#include "Ice/Config.h"

//
// Automatically link with IceStorm[D].lib
//
// This header is included in the IceStorm generated header.

#if !defined(ICE_BUILDING_ICESTORM_LIB) && defined(ICESTORM_API_EXPORTS)
# define ICE_BUILDING_ICESTORM_LIB
#endif
#include "Ice/Config.h"

#if defined(_MSC_VER) && !defined(ICE_BUILDING_ICESTORM_LIB)
# pragma comment(lib, ICE_LIBNAME("IceStorm"))
#if defined(_MSC_VER) && !defined(ICESTORM_API_EXPORTS)
# pragma comment(lib, ICE_LIBNAME("IceStorm")) // Automatically link with IceStorm[D].lib
#endif

#endif
3 changes: 1 addition & 2 deletions cpp/src/Glacier2Lib/NullPermissionsVerifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#ifndef GLACIER2_NULL_PERMISSIONS_VERIFIER_H
#define GLACIER2_NULL_PERMISSIONS_VERIFIER_H

#include "Glacier2/Config.h"
#include "Ice/Ice.h"
#include "Glacier2/Glacier2.h"

#include <string>
#include <vector>
Expand Down
9 changes: 3 additions & 6 deletions cpp/src/IceDB/IceDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@
# endif
#endif

#if !defined(ICE_BUILDING_ICE_DB) && defined(ICE_DB_API_EXPORTS)
# define ICE_BUILDING_ICE_DB
#endif

#if defined(_MSC_VER) && !defined(ICE_BUILDING_ICE_DB)
# pragma comment(lib, ICE_LIBNAME("IceDB")) // Automatically link IceDBxx[D].lib with Visual C++
#if defined(_MSC_VER) && !defined(ICE_DB_API_EXPORTS)
// Automatically link IceDBxx[D].lib
# pragma comment(lib, ICE_LIBNAME("IceDB"))
#endif

namespace IceDB
Expand Down
22 changes: 10 additions & 12 deletions cpp/src/IceLocatorDiscovery/Plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@

#include <chrono>

#if !defined(ICE_BUILDING_ICE_LOCATOR_DISCOVERY) && defined(ICE_LOCATOR_DISCOVERY_API_EXPORTS)
# define ICE_BUILDING_ICE_LOCATOR_DISCOVERY
#endif

#if defined(_MSC_VER) && !defined(ICE_BUILDING_ICE_LOCATOR_DISCOVERY)
# pragma comment( \
lib, \
ICE_LIBNAME("IceLocatorDiscovery")) // Automatically link IceLocatorDiscovery[D].lib with Visual C++
#endif

#ifndef ICE_LOCATOR_DISCOVERY_API
# if defined(ICE_LOCATOR_DISCOVERY_API_EXPORTS)
# define ICE_LOCATOR_DISCOVERY_API ICE_DECLSPEC_EXPORT
Expand All @@ -27,6 +17,15 @@
# endif
#endif

#if !defined(ICE_BUILDING_ICE_LOCATOR_DISCOVERY) && defined(ICE_LOCATOR_DISCOVERY_API_EXPORTS)
# define ICE_BUILDING_ICE_LOCATOR_DISCOVERY
#endif

// For icegridadmin
#if defined(_MSC_VER) && !defined(ICE_BUILDING_ICE_LOCATOR_DISCOVERY)
# pragma comment(lib, ICE_LIBNAME("IceLocatorDiscovery")) // Automatically link IceLocatorDiscovery[D].lib
#endif

namespace IceLocatorDiscovery
{
class ICE_LOCATOR_DISCOVERY_API Plugin : public Ice::Plugin
Expand All @@ -36,7 +35,6 @@ namespace IceLocatorDiscovery
getLocators(const std::string&, const std::chrono::milliseconds&) const = 0;
};
using PluginPtr = std::shared_ptr<Plugin>;

};
}

#endif
16 changes: 4 additions & 12 deletions cpp/src/IceStorm/Service.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
#include "IceBox/IceBox.h"
#include "IceStorm/IceStorm.h"

//
// Automatically link with IceStormService[D].lib
//

#if !defined(ICE_BUILDING_ICESTORM_SERVICE) && defined(ICESTORM_SERVICE_API_EXPORTS)
# define ICE_BUILDING_ICESTORM_SERVICE
#endif

#if defined(_MSC_VER) && !defined(ICE_BUILDING_ICESTORM_SERVICE)
# pragma comment(lib, ICE_LIBNAME("IceStormService"))
#endif

// These IceStorm APIs are exported because they are used by IceGrid
#ifndef ICESTORM_SERVICE_API
# if defined(ICESTORM_SERVICE_API_EXPORTS)
Expand All @@ -27,6 +15,10 @@
# endif
#endif

#if defined(_MSC_VER) && !defined(ICESTORM_SERVICE_API_EXPORTS)
# pragma comment(lib, ICE_LIBNAME("IceStormService")) // Automatically link with IceStormService[D].lib
#endif

// This API is internal to Ice, and should not be used by external applications.
namespace IceStormInternal
{
Expand Down
Loading