/*
 *  Module.h
 *  GerberConversion
 *
 *  Created by Martin Štrympl on 11/3/10.
 *  Copyright 2010 School. All rights reserved.
 *
 */
 
/*
 GerberConversion
 Copyright (C) 2010 Martin Štrympl
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public
 License as published by the Free Software Foundation; either
 version 3.0 of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 General Public License for more details.
 
 You should have received a copy of the GNU General Public
 License along with this program.
 
 Martin Štrympl
 xstrym00@stud.feec.vutbr.cz
 */

// windows or mac os x

#ifndef MODULE_H_INCLUDED
#define MODULE_H_INCLUDED

#if defined(WIN32) || defined(_WIN32)
  #undef __WIN32__
  #define __WIN32__	1
#endif
 

#ifndef __WIN32__
  #if __GNUC__ >= 4
    #define MODULEAPI __attribute__ ((visibility("default")))
    #define MODULEMY  __attribute__ ((visibility("hidden")))
    #define MODULESO
    
    #define MODULECALL
  #else
    #error Low gcc version.
  #endif
#else
  #define MODULEAPI __declspec(dllexport)
  #define MODULEMY __declspec(dllimport)
  #define MODULEDLL
  
  #define MODULECALL
#endif // __WIN32__

typedef int (*fGerber_Module_Start)(const char **at_args, uint32_t u4_args, void **pv_memory);
typedef void (*fGerber_Module_End)(void *v_memory);

#define Mac_Head_Gerber_Module_Start char **at_args, uint32_t u4_args, void **pv_memory
#define Mac_Head_Gerber_Module_End void *v_memory

#define Mac_Fun_Gerber_Module_Start(name) int MODULECALL name(Mac_Head_Gerber_Module_Start)
#define Mac_Fun_Gerber_Module_End(name) void MODULECALL name(Mac_Head_Gerber_Module_End)

#endif // MODULE_H_INCLUDED
