////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This is a part of the COM Serialization SDK VC++ Library.
//  
// Copyright 2009 BPM Microsystems
// 
// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//                                                                                                                    //
// $Header: //sesca/src/Winprog/COMSerializationSDK/VC++/HeaderLib/ComSerSdk/rcs/Preproc.h 1.1 2009/08/17 12:39:00 arturoc Exp $
//                                                                                                                    //
///////// 120 columns, Tab = Insert 3 Spaces ///////////////////////////////////////////////////////////////////////////

#pragma once

#include "Detail/PreprocExpand.h"
#include "Detail/PreprocCat.h"
#include "Detail/PreprocStringize.h"

/**
   If no name is specified for the ESS by the library-user, then we will use a default of
   "ExternalSerializationServer".
*/
#ifndef COMSERSDK_ESS_NAME
   #define COMSERSDK_ESS_NAME ExternalSerializationServer
#else
   #define COMSERSDK_USER_SPECIFIED_ESS_NAME
#endif

/**
   Create a C++ class name and a module name from the ESS_NAME.  Do it slightly differently if it was user-specified.
*/
#if defined(COMSERSDK_USER_SPECIFIED_ESS_NAME)
#  define COMSERSDK_ESS_ITF_NAME COMSERSDK_PP_CAT(I, COMSERSDK_ESS_NAME)
#  define COMSERSDK_ESS_CPP_CLASS_NAME COMSERSDK_ESS_NAME
#  define COMSERSDK_ESS_MODULE_NAME COMSERSDK_PP_CAT(ComSerSdk_Detail_C, \
                                           COMSERSDK_EXPAND(COMSERSDK_PP_CAT(COMSERSDK_ESS_NAME, Module)))
#else
#  define COMSERSDK_ESS_ITF_NAME ISerialServer
#  define COMSERSDK_ESS_CPP_CLASS_NAME CExternalSerializationServer
#  define COMSERSDK_ESS_MODULE_NAME ComSerSdk_Detail_CEssModule
#endif

/**
   We are forced to use string-literals to specify GUIDs in the ATL atttibutes.  We also must specify these in
   the registration information.  The one way that we can define them once and only once and use them in all necessary
   locations is with macros, therefore we reluctantly resort to defining them with macros.

   This one is the CLSID of the ESS, which is specified in the SDK documentation, item 3.1 of "Appendix: ESS
   Requirements".
*/
#define COMSERSDK_ESS_CLSID "7A61987B-66D9-41c8-973B-846CC37FC1A5"

/**
   Stringized version of COMSERSDK_ESS_NAME.
*/
#define COMSERSDK_ESS_NAME_STRING COMSERSDK_EXPAND(COMSERSDK_STRINGIZE(COMSERSDK_ESS_NAME))

/**
   Build a library name based on COMSERSDK_ESS_NAME.
*/
#define COMSERSDK_LIBRARY_NAME COMSERSDK_PP_CAT(COMSERSDK_ESS_NAME, Lib)

/**
   Stringized version of COMSERSDK_LIBRARY_NAME.
*/
#define COMSERSDK_LIBRARY_NAME_STRING COMSERSDK_EXPAND(COMSERSDK_STRINGIZE(COMSERSDK_LIBRARY_NAME))

/**
   The programatic identifier for an ESS implemented using this library.  One may not be necessary, and BPWin
   doesn't require one.  However, ProgId's are almost universally expected to exist for COM objects.
*/
#if defined(COMSERSDK_USER_SPECIFIED_ESS_NAME)
#  define COMSERSDK_ESS_PROGID "BpmEss." COMSERSDK_ESS_NAME_STRING
#else
#  define COMSERSDK_ESS_PROGID "BpmEss.Generic"
#endif