Home | History | Annotate | Download | only in OpenglOsUtils
      1 /*
      2 * Copyright (C) 2011 The Android Open Source Project
      3 *
      4 * Licensed under the Apache License, Version 2.0 (the "License");
      5 * you may not use this file except in compliance with the License.
      6 * You may obtain a copy of the License at
      7 *
      8 * http://www.apache.org/licenses/LICENSE-2.0
      9 *
     10 * Unless required by applicable law or agreed to in writing, software
     11 * distributed under the License is distributed on an "AS IS" BASIS,
     12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 * See the License for the specific language governing permissions and
     14 * limitations under the License.
     15 */
     16 #ifndef _OSUTILS_DYN_LIBRARY_H
     17 #define _OSUTILS_DYN_LIBRARY_H
     18 
     19 #ifdef _WIN32
     20 #include <windows.h>
     21 #endif
     22 
     23 namespace osUtils {
     24 
     25 typedef void (*dynFuncPtr)(void);
     26 
     27 class dynLibrary
     28 {
     29 public:
     30     static dynLibrary *open(const char *p_libName);
     31     ~dynLibrary();
     32 
     33     dynFuncPtr findSymbol(const char *p_symName);
     34 
     35 private:
     36     dynLibrary();
     37 
     38 private:
     39 #ifdef _WIN32
     40     HMODULE m_lib;
     41 #else
     42     void *m_lib;
     43 #endif
     44 };
     45 
     46 } // of namespace osUtils
     47 
     48 #endif
     49