Commit 4612ef9d authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

switch to new s-expression format for footprint exports, use english...

switch to new s-expression format for footprint exports, use english layernames for naked footprints, dodge conflict with pythons HAVE_GETC_UNLOCKED
parent d378dcc7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ macro(perform_feature_checks)

    # Check for Posix getc_unlocked() for improved performance over getc().  Fall back to
    # getc() on platforms where getc_unlocked() doesn't exist.
    check_symbol_exists(getc_unlocked "stdio.h" HAVE_GETC_UNLOCKED)
    check_symbol_exists(getc_unlocked "stdio.h" HAVE_FGETC_NOLOCK)

    # Generate config.h.
    configure_file(${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
+4 −4
Original line number Diff line number Diff line
/* Do not modify this file, it was automatically generated by CMake. */
// Do not modify this file, it was automatically generated by CMake.

#ifndef CONFIG_H_
#define CONFIG_H_
@@ -50,10 +50,10 @@
#define strnicmp _strnicmp
#endif

/* Use Posix getc_unlocked() instead of getc() when it's available. */
#cmakedefine HAVE_GETC_UNLOCKED
// Use Posix getc_unlocked() instead of getc() when it's available.
#cmakedefine HAVE_FGETC_NOLOCK

/* Warning!!!  Using wxGraphicContext for rendering is experimental. */
// Warning!!!  Using wxGraphicContext for rendering is experimental.
#cmakedefine USE_WX_GRAPHICS_CONTEXT 1

#cmakedefine USE_IMAGES_IN_MENUS 1
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@


// Fall back to getc() when getc_unlocked() is not available on the target platform.
#if !defined( HAVE_GETC_UNLOCKED )
#if !defined( HAVE_FGETC_NOLOCK )
#define getc_unlocked getc
#endif

+4 −5
Original line number Diff line number Diff line
@@ -76,14 +76,13 @@ BOARD* BOARD_ITEM::GetBoard() const

wxString BOARD_ITEM::GetLayerName() const
{
    wxString layerName;
    BOARD*  board = GetBoard();

    if( board != NULL )
    if( board )
        return board->GetLayerName( m_Layer ).Trim();

    // If no parent, return the default layer for the object.
    return BOARD::GetDefaultLayerName( m_Layer, true );
    // If no parent, return the untranslated layer name.
    return BOARD::GetDefaultLayerName( m_Layer, false );
}


+11 −3
Original line number Diff line number Diff line
@@ -388,6 +388,14 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const

void PCB_IO::formatLayer( const BOARD_ITEM* aItem ) const
{
    if( m_ctl & CTL_UNTRANSLATED_LAYERS )
    {
        int layer = aItem->GetLayer();

        // English layer names should never need quoting.
        m_out->Print( 0, " (layer %s)", TO_UTF8( BOARD::GetDefaultLayerName( layer, false ) ) );
    }
    else
        m_out->Print( 0, " (layer %s)", m_out->Quotew( aItem->GetLayerName() ).c_str() );
}

@@ -1048,7 +1056,7 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
    {
        if( layerMask & 1 )
        {
            if( m_board )
            if( m_board && !(m_ctl & CTL_UNTRANSLATED_LAYERS) )
                layerName = m_board->GetLayerName( layer );

            else    // from FootprintSave()
@@ -1061,7 +1069,7 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
    m_out->Print( 0, ")\n" );

    // Unconnected pad is default net so don't save it.
    if( !(m_ctl & CTL_CLIPBOARD) && aPad->GetNet() != 0 )
    if( !(m_ctl & CTL_OMIT_NETS) && aPad->GetNet() != 0 )
    {
        m_out->Print( aNestLevel+1, "(net %d %s)\n",
                      aPad->GetNet(), m_out->Quotew( aPad->GetNetname() ).c_str() );
Loading