f824fde36f
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5864 4adac7df-926f-26a2-2b94-8c16560cd09d
87 lines
3.5 KiB
Modula-2
87 lines
3.5 KiB
Modula-2
/*
|
|
* libjingle
|
|
* Copyright 2012, Google Inc.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions are met:
|
|
*
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
* this list of conditions and the following disclaimer.
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
* and/or other materials provided with the distribution.
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
* derived from this software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*/
|
|
|
|
// This file is a supermacro
|
|
// (see http://wanderinghorse.net/computing/papers/supermacros_cpp.html) to
|
|
// expand a definition of a late-binding symbol table class.
|
|
//
|
|
// Arguments:
|
|
// LATE_BINDING_SYMBOL_TABLE_CLASS_NAME: Name of the class to generate.
|
|
// LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST: List of symbols to load from the DLL,
|
|
// as an X-Macro list (see http://www.drdobbs.com/blogs/cpp/228700289).
|
|
// LATE_BINDING_SYMBOL_TABLE_DLL_NAME: String literal for the DLL file name to
|
|
// load.
|
|
//
|
|
// From a .cc file, include the header file containing your call to the .h.def
|
|
// supermacro, and then call this supermacro (optionally from inside the
|
|
// namespace for the class to generate, if any). Example:
|
|
//
|
|
// #include "myclassname.h"
|
|
//
|
|
// namespace foo {
|
|
//
|
|
// #define LATE_BINDING_SYMBOL_TABLE_CLASS_NAME MY_CLASS_NAME
|
|
// #define LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST MY_SYMBOLS_LIST
|
|
// #define LATE_BINDING_SYMBOL_TABLE_DLL_NAME "libdll.so.n"
|
|
// #include "talk/base/latebindingsymboltable.cc.def"
|
|
//
|
|
// }
|
|
|
|
#ifndef LATE_BINDING_SYMBOL_TABLE_CLASS_NAME
|
|
#error You must define LATE_BINDING_SYMBOL_TABLE_CLASS_NAME
|
|
#endif
|
|
|
|
#ifndef LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST
|
|
#error You must define LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST
|
|
#endif
|
|
|
|
#ifndef LATE_BINDING_SYMBOL_TABLE_DLL_NAME
|
|
#error You must define LATE_BINDING_SYMBOL_TABLE_DLL_NAME
|
|
#endif
|
|
|
|
#define X(sym) #sym,
|
|
const char* const LATE_BINDING_SYMBOL_TABLE_CLASS_NAME::kSymbolNames[] = {
|
|
LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST
|
|
};
|
|
#undef X
|
|
|
|
const ::talk_base::LateBindingSymbolTable::TableInfo
|
|
LATE_BINDING_SYMBOL_TABLE_CLASS_NAME::kTableInfo = {
|
|
LATE_BINDING_SYMBOL_TABLE_DLL_NAME,
|
|
SYMBOL_TABLE_SIZE,
|
|
LATE_BINDING_SYMBOL_TABLE_CLASS_NAME::kSymbolNames
|
|
};
|
|
|
|
LATE_BINDING_SYMBOL_TABLE_CLASS_NAME::LATE_BINDING_SYMBOL_TABLE_CLASS_NAME()
|
|
: ::talk_base::LateBindingSymbolTable(&kTableInfo, table_) {}
|
|
|
|
LATE_BINDING_SYMBOL_TABLE_CLASS_NAME::~LATE_BINDING_SYMBOL_TABLE_CLASS_NAME() {}
|
|
|
|
#undef LATE_BINDING_SYMBOL_TABLE_CLASS_NAME
|
|
#undef LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST
|
|
#undef LATE_BINDING_SYMBOL_TABLE_DLL_NAME
|